mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/test/unit/autorunner.rb: remove dependency to a particular
runner. [ruby-core:01901], [ruby-list:38869] * lib/test/unit/ui/testrunnerutilities.rb: moved output level constants from Console. * lib/test/unit/ui/console/testrunner.rb: ditto. * lib/test/unit/ui/{fox,gtk,gtk2,tk}/testrunner.rb (initialize): accept output_level. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3fb4d657d8
commit
e67e930462
8 changed files with 35 additions and 22 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
|||
Mon Dec 8 22:48:03 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/test/unit/autorunner.rb: remove dependency to a particular
|
||||
runner. [ruby-core:01901], [ruby-list:38869]
|
||||
|
||||
* lib/test/unit/ui/testrunnerutilities.rb: moved output level
|
||||
constants from Console.
|
||||
|
||||
* lib/test/unit/ui/console/testrunner.rb: ditto.
|
||||
|
||||
* lib/test/unit/ui/{fox,gtk,gtk2,tk}/testrunner.rb (initialize):
|
||||
accept output_level.
|
||||
|
||||
Mon Dec 8 15:03:30 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/syck/syck.c (syck_io_str_read): get rid of buffer overflow.
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
require 'test/unit/ui/testrunnerutilities'
|
||||
require 'optparse'
|
||||
|
||||
require 'test/unit/ui/console/testrunner'
|
||||
|
||||
module Test
|
||||
module Unit
|
||||
class AutoRunner
|
||||
|
@ -17,31 +16,32 @@ module Test
|
|||
|
||||
RUNNERS = {
|
||||
:console => proc do |r|
|
||||
Test::Unit::UI::Console::TestRunner.run(r.suite, r.output_level)
|
||||
require 'test/unit/ui/console/testrunner'
|
||||
Test::Unit::UI::Console::TestRunner
|
||||
end,
|
||||
:gtk => proc do |r|
|
||||
require 'test/unit/ui/gtk/testrunner'
|
||||
Test::Unit::UI::GTK::TestRunner.run(r.suite)
|
||||
Test::Unit::UI::GTK::TestRunner
|
||||
end,
|
||||
:gtk2 => proc do |r|
|
||||
require 'test/unit/ui/gtk2/testrunner'
|
||||
Test::Unit::UI::GTK2::TestRunner.run(r.suite)
|
||||
Test::Unit::UI::GTK2::TestRunner
|
||||
end,
|
||||
:fox => proc do |r|
|
||||
require 'test/unit/ui/fox/testrunner'
|
||||
Test::Unit::UI::Fox::TestRunner.run(r.suite)
|
||||
Test::Unit::UI::Fox::TestRunner
|
||||
end,
|
||||
:tk => proc do |r|
|
||||
require 'test/unit/ui/tk/testrunner'
|
||||
Test::Unit::UI::Tk::TestRunner.run(r.suite)
|
||||
Test::Unit::UI::Tk::TestRunner
|
||||
end,
|
||||
}
|
||||
|
||||
OUTPUT_LEVELS = {
|
||||
:silent => UI::Console::TestRunner::SILENT,
|
||||
:progress => UI::Console::TestRunner::PROGRESS_ONLY,
|
||||
:normal => UI::Console::TestRunner::NORMAL,
|
||||
:verbose => UI::Console::TestRunner::VERBOSE,
|
||||
:silent => UI::SILENT,
|
||||
:progress => UI::PROGRESS_ONLY,
|
||||
:normal => UI::NORMAL,
|
||||
:verbose => UI::VERBOSE,
|
||||
}
|
||||
|
||||
COLLECTORS = {
|
||||
|
@ -71,7 +71,7 @@ module Test
|
|||
@collector = COLLECTORS[(standalone ? :dir : :objectspace)]
|
||||
@filters = []
|
||||
@to_run = []
|
||||
@output_level = Test::Unit::UI::Console::TestRunner::NORMAL
|
||||
@output_level = UI::NORMAL
|
||||
yield(self) if(block_given?)
|
||||
end
|
||||
|
||||
|
@ -180,7 +180,7 @@ module Test
|
|||
def run
|
||||
@suite = @collector[self]
|
||||
result = @runner[self] or return false
|
||||
result.passed?
|
||||
result.run(@suite, @output_level).passed?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -16,11 +16,6 @@ module Test
|
|||
class TestRunner
|
||||
extend TestRunnerUtilities
|
||||
|
||||
SILENT = 0
|
||||
PROGRESS_ONLY = 1
|
||||
NORMAL = 2
|
||||
VERBOSE = 3
|
||||
|
||||
# Creates a new TestRunner and runs the suite.
|
||||
def self.run(suite, output_level=NORMAL)
|
||||
return new(suite, output_level).start
|
||||
|
|
|
@ -34,7 +34,7 @@ module Test
|
|||
|
||||
# Creates a new TestRunner for running the passed
|
||||
# suite.
|
||||
def initialize(suite)
|
||||
def initialize(suite, output_level = NORMAL)
|
||||
if (suite.respond_to?(:suite))
|
||||
@suite = suite.suite
|
||||
else
|
||||
|
|
|
@ -27,7 +27,7 @@ module Test
|
|||
|
||||
# Creates a new TestRunner for running the passed
|
||||
# suite.
|
||||
def initialize(suite)
|
||||
def initialize(suite, output_level = NORMAL)
|
||||
if (suite.respond_to?(:suite))
|
||||
@suite = suite.suite
|
||||
else
|
||||
|
|
|
@ -440,7 +440,7 @@ module Test
|
|||
@result
|
||||
end # def start
|
||||
|
||||
def initialize(suite)
|
||||
def initialize(suite, output_level = NORMAL)
|
||||
if suite.respond_to?(:suite) then
|
||||
@suite = suite.suite
|
||||
else
|
||||
|
|
|
@ -8,6 +8,11 @@ module Test
|
|||
module Unit
|
||||
module UI
|
||||
|
||||
SILENT = 0
|
||||
PROGRESS_ONLY = 1
|
||||
NORMAL = 2
|
||||
VERBOSE = 3
|
||||
|
||||
# Provides some utilities common to most, if not all,
|
||||
# TestRunners.
|
||||
#
|
||||
|
|
|
@ -28,7 +28,7 @@ module Test
|
|||
|
||||
# Creates a new TestRunner for running the passed
|
||||
# suite.
|
||||
def initialize(suite)
|
||||
def initialize(suite, output_level = NORMAL)
|
||||
if (suite.respond_to?(:suite))
|
||||
@suite = suite.suite
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue