mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/test/unit.rb(Test::Unit::Options#process_args): Fix bug.
Fix process_args didn't return `@option` after r30939. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7fd8266516
commit
1d4da24e21
2 changed files with 19 additions and 21 deletions
|
@ -1,3 +1,8 @@
|
|||
Tue Jul 12 16:58:44 2011 Shota Fukumori <sorah@tubusu.net>
|
||||
|
||||
* lib/test/unit.rb(Test::Unit::Options#process_args): Fix bug.
|
||||
Fix process_args didn't return `@option` after r30939.
|
||||
|
||||
Tue Jul 12 14:07:46 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* signal.c (install_sighandler): fixed a race.
|
||||
|
|
|
@ -52,11 +52,11 @@ module Test
|
|||
non_options(args, options)
|
||||
@help = orig_args.map { |s| s =~ /[\s|&<>$()]/ ? s.inspect : s }.join " "
|
||||
@options = options
|
||||
@opts = @options = options
|
||||
if @options[:parallel]
|
||||
@files = args
|
||||
@args = orig_args
|
||||
end
|
||||
options
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -319,12 +319,6 @@ module Test
|
|||
|
||||
class << self; undef autorun; end
|
||||
|
||||
undef options
|
||||
|
||||
def options
|
||||
@optss ||= (@options||{}).merge(@opts)
|
||||
end
|
||||
|
||||
@@stop_auto_run = false
|
||||
def self.autorun
|
||||
at_exit {
|
||||
|
@ -336,7 +330,7 @@ module Test
|
|||
end
|
||||
|
||||
def after_worker_down(worker, e=nil, c=false)
|
||||
return unless @opts[:parallel]
|
||||
return unless @options[:parallel]
|
||||
return if @interrupt
|
||||
if e
|
||||
b = e.backtrace
|
||||
|
@ -354,10 +348,10 @@ module Test
|
|||
end
|
||||
|
||||
def jobs_status
|
||||
return unless @opts[:job_status]
|
||||
puts "" unless @opts[:verbose]
|
||||
return unless @options[:job_status]
|
||||
puts "" unless @options[:verbose]
|
||||
status_line = @workers.map(&:to_s).join(" ")
|
||||
if @opts[:job_status] == :replace and $stdout.tty?
|
||||
if @options[:job_status] == :replace and $stdout.tty?
|
||||
@terminal_width ||=
|
||||
begin
|
||||
require 'io/console'
|
||||
|
@ -377,12 +371,12 @@ module Test
|
|||
end
|
||||
|
||||
def del_jobs_status
|
||||
return unless @opts[:job_status] == :replace && @jstr_size.nonzero?
|
||||
return unless @options[:job_status] == :replace && @jstr_size.nonzero?
|
||||
print "\r"+" "*@jstr_size+"\r"
|
||||
end
|
||||
|
||||
def after_worker_quit(worker)
|
||||
return unless @opts[:parallel]
|
||||
return unless @options[:parallel]
|
||||
return if @interrupt
|
||||
@workers.delete(worker)
|
||||
@dead_workers << worker
|
||||
|
@ -390,7 +384,7 @@ module Test
|
|||
end
|
||||
|
||||
def _run_parallel suites, type, result
|
||||
if @opts[:parallel] < 1
|
||||
if @options[:parallel] < 1
|
||||
warn "Error: parameter of -j option should be greater than 0."
|
||||
return
|
||||
end
|
||||
|
@ -407,8 +401,8 @@ module Test
|
|||
rep = [] # FIXME: more good naming
|
||||
|
||||
# Array of workers.
|
||||
@workers = @opts[:parallel].times.map {
|
||||
worker = Worker.launch(@opts[:ruby],@args)
|
||||
@workers = @options[:parallel].times.map {
|
||||
worker = Worker.launch(@options[:ruby],@args)
|
||||
worker.hook(:dead) do |w,info|
|
||||
after_worker_quit w
|
||||
after_worker_down w, *info unless info.empty?
|
||||
|
@ -459,7 +453,7 @@ module Test
|
|||
when /^p (.+?)$/
|
||||
del_jobs_status
|
||||
print $1.unpack("m")[0]
|
||||
jobs_status if @opts[:job_status] == :replace
|
||||
jobs_status if @options[:job_status] == :replace
|
||||
when /^after (.+?)$/
|
||||
@warnings << Marshal.load($1.unpack("m")[0])
|
||||
when /^bye (.+?)$/
|
||||
|
@ -521,7 +515,7 @@ module Test
|
|||
end
|
||||
end
|
||||
|
||||
if @interrupt || @opts[:no_retry] || @need_quit
|
||||
if @interrupt || @options[:no_retry] || @need_quit
|
||||
rep.each do |r|
|
||||
report.push(*r[:report])
|
||||
end
|
||||
|
@ -532,7 +526,6 @@ module Test
|
|||
puts ""
|
||||
puts "Retrying..."
|
||||
puts ""
|
||||
@options = @opts
|
||||
rep.each do |r|
|
||||
if r[:testcase] && r[:file] && !r[:report].empty?
|
||||
require r[:file]
|
||||
|
@ -564,7 +557,7 @@ module Test
|
|||
def _run_suites suites, type
|
||||
@interrupt = nil
|
||||
result = []
|
||||
if @opts[:parallel]
|
||||
if @options[:parallel]
|
||||
_run_parallel suites, type, result
|
||||
else
|
||||
suites.each {|suite|
|
||||
|
@ -576,7 +569,7 @@ module Test
|
|||
end
|
||||
}
|
||||
end
|
||||
report.reject!{|r| r.start_with? "Skipped:" } if @opts[:hide_skip]
|
||||
report.reject!{|r| r.start_with? "Skipped:" } if @options[:hide_skip]
|
||||
result
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue