diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-01 22:15:15 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-01 22:15:15 +0000 |
commit | 64740adcffbb18b298086ebff4d41c512fbc9435 (patch) | |
tree | 19543e6b3268678b826bede6e1c2162d84a251c4 | |
parent | 0e24a11b597840f4690ac9738fbc3a2f7fa61b8a (diff) | |
download | ruby-64740adcffbb18b298086ebff4d41c512fbc9435.tar.gz |
* lib/test/unit.rb (Test::Unit::Mini#_run_suites): show the result
even when interrupted on the way.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/test/unit.rb | 20 |
2 files changed, 23 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Thu Dec 2 07:15:12 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * lib/test/unit.rb (Test::Unit::Mini#_run_suites): show the result + even when interrupted on the way. + Thu Dec 2 07:08:38 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> * ext/io/console/console.c (setattr): should retry on EINTR. diff --git a/lib/test/unit.rb b/lib/test/unit.rb index e2cff085ef..77f01fac15 100644 --- a/lib/test/unit.rb +++ b/lib/test/unit.rb @@ -163,8 +163,24 @@ module Test @@installed_at_exit = true end - def run(*args) - super + def _run_suites suites, type + @interrupt = nil + result = [] + suites.each {|suite| + begin + result << _run_suite(suite, type) + rescue Interrupt => e + @interrupt = e + break + end + } + result + end + + def status(*args) + result = super + raise @interrupt if @interrupt + result end end end |