summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-16 13:09:44 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-16 13:09:44 +0000
commitd98d3fe12a46203b056c23f50d845028e3a73a7a (patch)
treed7cf704834d3f35b38b23f4a86b3b9ed9a861a98
parent048d2e6d32315e13962a01e8df6459487c57b98c (diff)
* lib/test/unit.rb, bin/testrb, test/runner.rb: revert r28655, which
broke test-all. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rwxr-xr-xbin/testrb4
-rw-r--r--lib/test/unit.rb36
-rw-r--r--test/runner.rb2
4 files changed, 12 insertions, 35 deletions
diff --git a/ChangeLog b/ChangeLog
index 615edb6..86964ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Jul 16 22:08:10 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * lib/test/unit.rb, bin/testrb, test/runner.rb: revert r28655, which
+ broke test-all.
+
Fri Jul 16 14:58:38 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/test/unit.rb (Test::Unit.setup_argv): run tests only when
diff --git a/bin/testrb b/bin/testrb
index 6a65fba..e4eb909 100755
--- a/bin/testrb
+++ b/bin/testrb
@@ -1,9 +1,9 @@
#!/usr/bin/env ruby
require 'test/unit'
-exit Test::Unit.start {|files|
+Test::Unit.setup_argv {|files|
if files.empty?
puts "Usage: testrb [options] tests..."
- exit false
+ exit 1
end
if files.size == 1
$0 = File.basename(files[0])
diff --git a/lib/test/unit.rb b/lib/test/unit.rb
index b518426..4aecc49 100644
--- a/lib/test/unit.rb
+++ b/lib/test/unit.rb
@@ -9,21 +9,7 @@ module Test
module Unit
TEST_UNIT_IMPLEMENTATION = 'test/unit compatibility layer using minitest'
- @@installed_at_exit = true
- @@run_count = 0
-
- RunCount = Module.new do
- def run(*)
- @@run_count += 1
- super
- end
- end
-
- def self.new(*)
- super.extend(RunCount)
- end
-
- def self.setup_argv(original_argv=::ARGV)
+ def self.setup_argv(original_argv=ARGV)
minitest_argv = []
files = []
reject = []
@@ -81,23 +67,9 @@ module Test
end
}
- at_exit {
- next if @@run_count.nonzero?
- next if $! # don't run if there was an exception
- exit false unless run(minitest_argv)
- } unless @@installed_at_exit
- @@installed_at_exit = true
-
- minitest_argv
- end
-
- def self.run(args)
- exit_code = MiniTest::Unit.new.run(args)
- !exit_code || exit_code == 0
- end
-
- def self.start(argv=::ARGV, &block)
- run(setup_argv(argv, &block))
+ ARGV.replace minitest_argv
end
end
end
+
+MiniTest::Unit.autorun
diff --git a/test/runner.rb b/test/runner.rb
index 3735461..3f1c8ab 100644
--- a/test/runner.rb
+++ b/test/runner.rb
@@ -6,7 +6,7 @@ require 'test/unit'
src_testdir = File.dirname(File.expand_path(__FILE__))
srcdir = File.dirname(src_testdir)
-exit Test::Unit.start {|files|
+Test::Unit.setup_argv {|files|
if files.empty?
[src_testdir]
else