mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/test/unit.rb (Test::Unit::Mini#run): abort if interrupted.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b560b08014
commit
5383964f98
2 changed files with 11 additions and 1 deletions
|
@ -1,4 +1,6 @@
|
||||||
Sun Oct 24 14:17:58 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sun Oct 24 15:16:30 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/test/unit.rb (Test::Unit::Mini#run): abort if interrupted.
|
||||||
|
|
||||||
* lib/test/unit.rb (Test::Unit::Mini#run_test_suites): show the
|
* lib/test/unit.rb (Test::Unit::Mini#run_test_suites): show the
|
||||||
result even when interrupted on the way.
|
result even when interrupted on the way.
|
||||||
|
|
|
@ -162,10 +162,18 @@ module Test
|
||||||
@@installed_at_exit = true
|
@@installed_at_exit = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def run(*args)
|
||||||
|
result = super
|
||||||
|
abort if @interrupt
|
||||||
|
result
|
||||||
|
end
|
||||||
|
|
||||||
def run_test_suites(*args)
|
def run_test_suites(*args)
|
||||||
old_sync = @@out.sync if @@out.respond_to?(:sync=)
|
old_sync = @@out.sync if @@out.respond_to?(:sync=)
|
||||||
|
@interrupt = false
|
||||||
super
|
super
|
||||||
rescue Interrupt
|
rescue Interrupt
|
||||||
|
@interrupt = true
|
||||||
[@test_count, @assertion_count]
|
[@test_count, @assertion_count]
|
||||||
ensure
|
ensure
|
||||||
@@out.sync = old_sync if @@out.respond_to?(:sync=)
|
@@out.sync = old_sync if @@out.respond_to?(:sync=)
|
||||||
|
|
Loading…
Reference in a new issue