diff options
author | Micah Anderson <micah@leap.se> | 2014-09-15 16:37:28 -0400 |
---|---|---|
committer | Micah Anderson <micah@leap.se> | 2014-09-15 16:37:28 -0400 |
commit | 4690472d628f899d5784c6a9826309b5fc47002e (patch) | |
tree | 993cce800f4b57df76b5529dd93fad93a2cdf2fd /bin/run_tests | |
parent | 77fe62679399c8a780106a50f579f0194be46e6b (diff) | |
parent | 027b26f0a1eda93b203d095c9ea2a83e51f90c12 (diff) |
Merge branch 'add_ignore' into develop
Diffstat (limited to 'bin/run_tests')
-rwxr-xr-x | bin/run_tests | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/bin/run_tests b/bin/run_tests index 586a8ca1..e026b5f7 100755 --- a/bin/run_tests +++ b/bin/run_tests @@ -41,6 +41,7 @@ end ## # this class is raised if a test file wants to be skipped entirely. +# (to skip an individual test, MiniTest::Skip is used instead) class SkipTest < Exception end @@ -62,6 +63,8 @@ end class LeapTest < MiniTest::Unit::TestCase class Pass < MiniTest::Assertion end + class Ignore < MiniTest::Assertion + end def initialize(name) super(name) @@ -101,6 +104,13 @@ class LeapTest < MiniTest::Unit::TestCase end # + # Called when the test should be silently ignored. + # + def ignore + raise LeapTest::Ignore + end + + # # the default fail() is part of the kernel and it just throws a runtime exception. for tests, # we want the same behavior as assert(false) # @@ -332,6 +342,7 @@ class LeapRunner < MiniTest::Unit def initialize @passes = 0 @warnings = 0 + @ignores = 0 super end @@ -372,9 +383,12 @@ class LeapRunner < MiniTest::Unit case e when MiniTest::Skip then @skips += 1 - #if @verbose - report_line("SKIP", klass, meth, e, e.message) - #end + report_line("SKIP", klass, meth, e, e.message) + when LeapTest::Ignore then + @ignores += 1 + if @verbose + report_line("IGNORE", klass, meth, e, e.message) + end when LeapTest::Pass then @passes += 1 report_line("PASS", klass, meth) |