diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-02 12:31:44 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-02 12:31:44 +0000 |
| commit | e3ecad11840d11d6cf6f2cc88d374a673081379c (patch) | |
| tree | 5eaee7e1c2ed82189f71b1102a43198ea4956b4d /lib/test/unit/ui | |
| parent | 9124cc822046fb694a4e8b6013f300c8a5132676 (diff) | |
| download | ruby-e3ecad11840d11d6cf6f2cc88d374a673081379c.tar.gz ruby-e3ecad11840d11d6cf6f2cc88d374a673081379c.tar.xz ruby-e3ecad11840d11d6cf6f2cc88d374a673081379c.zip | |
* bin/testrb: new test runner. [ruby-core:01845]
* lib/test/unit/autorunner.rb (Test::Unit::AutoRunner.run,
Test::Unit::AutoRunner#initialize): take test list to run.
* lib/test/unit/autorunner.rb (Test::Unit::AutoRunner::RUNNERS,
Test::Unit::AutoRunner#run): should not exit inside a library, just
return the result instead.
* lib/test/unit.rb: ditto.
* test/runner.rb: exit with the test result.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/test/unit/ui')
| -rw-r--r-- | lib/test/unit/ui/fox/testrunner.rb | 3 | ||||
| -rw-r--r-- | lib/test/unit/ui/gtk/testrunner.rb | 4 | ||||
| -rw-r--r-- | lib/test/unit/ui/gtk2/testrunner.rb | 5 | ||||
| -rw-r--r-- | lib/test/unit/ui/tk/testrunner.rb | 6 |
4 files changed, 14 insertions, 4 deletions
diff --git a/lib/test/unit/ui/fox/testrunner.rb b/lib/test/unit/ui/fox/testrunner.rb index 8b82ec634..b3c0ce0e4 100644 --- a/lib/test/unit/ui/fox/testrunner.rb +++ b/lib/test/unit/ui/fox/testrunner.rb @@ -41,6 +41,7 @@ module Test @suite = suite end + @result = nil @red = false end @@ -50,6 +51,7 @@ module Test setup_mediator attach_to_mediator start_ui + @result end def setup_mediator # :nodoc: @@ -132,6 +134,7 @@ module Test end def started(result) # :nodoc: + @result = result output_status("Started...") end diff --git a/lib/test/unit/ui/gtk/testrunner.rb b/lib/test/unit/ui/gtk/testrunner.rb index d6ce527fe..14fbce257 100644 --- a/lib/test/unit/ui/gtk/testrunner.rb +++ b/lib/test/unit/ui/gtk/testrunner.rb @@ -33,6 +33,7 @@ module Test else @suite = suite end + @result = nil @runner = Thread.current @restart_signal = Class.new(Exception) @@ -49,6 +50,7 @@ module Test setup_ui attach_to_mediator start_ui + @result end private @@ -94,7 +96,6 @@ module Test retry rescue end - exit !@red end def stop(*) # :nodoc: @@ -145,6 +146,7 @@ module Test end def started(result) # :nodoc: + @result = result output_status("Started...") end diff --git a/lib/test/unit/ui/gtk2/testrunner.rb b/lib/test/unit/ui/gtk2/testrunner.rb index 1efc7dd75..c68d7a205 100644 --- a/lib/test/unit/ui/gtk2/testrunner.rb +++ b/lib/test/unit/ui/gtk2/testrunner.rb @@ -322,6 +322,7 @@ module Test private :test_started def started(result) # :nodoc: + @result = result output_status("Started...") end # def started(result) private :started @@ -405,8 +406,8 @@ module Test rescue @restart_signal retry rescue + puts $!, $@ end - exit !@red end # def start_ui private :start_ui @@ -437,6 +438,7 @@ module Test setup_ui attach_to_mediator start_ui + @result end # def start def initialize(suite) @@ -445,6 +447,7 @@ module Test else @suite = suite end + @result = nil @runner = Thread.current @restart_signal = Class.new(Exception) diff --git a/lib/test/unit/ui/tk/testrunner.rb b/lib/test/unit/ui/tk/testrunner.rb index 3c3e0f554..9e444ca9a 100644 --- a/lib/test/unit/ui/tk/testrunner.rb +++ b/lib/test/unit/ui/tk/testrunner.rb @@ -34,6 +34,7 @@ module Test else @suite = suite end + @result = nil @red = false @fault_detail_list = [] @@ -52,6 +53,7 @@ module Test setup_mediator attach_to_mediator start_ui + @result end private @@ -102,7 +104,6 @@ module Test retry rescue end - exit !@red end def stop # :nodoc: @@ -112,7 +113,7 @@ module Test def reset_ui(count) # :nodoc: @test_total_count = count.to_f @test_progress_bar.configure('background'=>'green') - @test_progress_bar.place('relwidth'=>0/count) + @test_progress_bar.place('relwidth'=>(count.zero? ? 0 : 0/count)) @red = false @test_count_label.value = 0 @@ -155,6 +156,7 @@ module Test end def started(result) # :nodoc: + @result = result output_status("Started...") end |
