* bin/testrb: Use only Test::Unit::AutoRunner in test-unit gem
compatible API to be available by both test/unit bundled in Ruby and test-unit gem. * lib/test/unit.rb (Test::Unit::AutoRunner): Move codes from testrb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0ae90522a6
commit
98d69f426f
@ -1,3 +1,12 @@
|
|||||||
|
Sat Nov 3 17:55:07 2012 Kouhei Sutou <kou@cozmixng.org>
|
||||||
|
|
||||||
|
Sat Nov 3 17:53:43 2012 Kouhei Sutou <kou@cozmixng.org>
|
||||||
|
|
||||||
|
* bin/testrb: Use only Test::Unit::AutoRunner in test-unit gem
|
||||||
|
compatible API to be available by both test/unit bundled in Ruby
|
||||||
|
and test-unit gem.
|
||||||
|
* lib/test/unit.rb (Test::Unit::AutoRunner): Move codes from testrb.
|
||||||
|
|
||||||
Sat Nov 3 14:56:21 2012 Tadayoshi Funaba <tadf@dotrb.org>
|
Sat Nov 3 14:56:21 2012 Tadayoshi Funaba <tadf@dotrb.org>
|
||||||
|
|
||||||
* ext/date/date_parse.c (parse_eu): should capture apostrophe too.
|
* ext/date/date_parse.c (parse_eu): should capture apostrophe too.
|
||||||
|
@ -1,10 +1,3 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
tests = Test::Unit::AutoRunner.new(true)
|
exit Test::Unit::AutoRunner.run(true)
|
||||||
tests.options.banner.sub!(/\[options\]/, '\& tests...')
|
|
||||||
unless tests.process_args(ARGV)
|
|
||||||
abort tests.options.banner
|
|
||||||
end
|
|
||||||
files = tests.to_run
|
|
||||||
$0 = files.size == 1 ? File.basename(files[0]) : files.to_s
|
|
||||||
exit tests.run
|
|
||||||
|
@ -804,6 +804,7 @@ module Test
|
|||||||
attr_accessor :to_run, :options
|
attr_accessor :to_run, :options
|
||||||
|
|
||||||
def initialize(force_standalone = false, default_dir = nil, argv = ARGV)
|
def initialize(force_standalone = false, default_dir = nil, argv = ARGV)
|
||||||
|
@force_standalone = force_standalone
|
||||||
@runner = Runner.new do |files, options|
|
@runner = Runner.new do |files, options|
|
||||||
options[:base_directory] ||= default_dir
|
options[:base_directory] ||= default_dir
|
||||||
files << default_dir if files.empty? and default_dir
|
files << default_dir if files.empty? and default_dir
|
||||||
@ -813,6 +814,9 @@ module Test
|
|||||||
end
|
end
|
||||||
Runner.runner = @runner
|
Runner.runner = @runner
|
||||||
@options = @runner.option_parser
|
@options = @runner.option_parser
|
||||||
|
if @force_standalone
|
||||||
|
@options.banner.sub!(/\[options\]/, '\& tests...')
|
||||||
|
end
|
||||||
@argv = argv
|
@argv = argv
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -822,6 +826,9 @@ module Test
|
|||||||
end
|
end
|
||||||
|
|
||||||
def run
|
def run
|
||||||
|
if @force_standalone and not process_args(@argv)
|
||||||
|
abort @options.banner
|
||||||
|
end
|
||||||
@runner.run(@argv) || true
|
@runner.run(@argv) || true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user