Imported minitest 2.0.1 r6079.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
01c0fea7d3
commit
5c9194fe1f
@ -520,7 +520,7 @@ module MiniTest
|
|||||||
end
|
end
|
||||||
|
|
||||||
class Unit
|
class Unit
|
||||||
VERSION = "2.0.0" # :nodoc:
|
VERSION = "2.0.1" # :nodoc:
|
||||||
|
|
||||||
attr_accessor :report, :failures, :errors, :skips # :nodoc:
|
attr_accessor :report, :failures, :errors, :skips # :nodoc:
|
||||||
attr_accessor :test_count, :assertion_count # :nodoc:
|
attr_accessor :test_count, :assertion_count # :nodoc:
|
||||||
@ -552,8 +552,16 @@ module MiniTest
|
|||||||
def self.autorun
|
def self.autorun
|
||||||
at_exit {
|
at_exit {
|
||||||
next if $! # don't run if there was an exception
|
next if $! # don't run if there was an exception
|
||||||
|
|
||||||
|
# the order here is important. The at_exit handler must be
|
||||||
|
# installed before anyone else gets a chance to install their
|
||||||
|
# own, that way we can be assured that our exit will be last
|
||||||
|
# to run (at_exit stacks).
|
||||||
|
exit_code = nil
|
||||||
|
|
||||||
|
at_exit { exit false if exit_code && exit_code != 0 }
|
||||||
|
|
||||||
exit_code = MiniTest::Unit.new.run ARGV
|
exit_code = MiniTest::Unit.new.run ARGV
|
||||||
exit false if exit_code && exit_code != 0
|
|
||||||
} unless @@installed_at_exit
|
} unless @@installed_at_exit
|
||||||
@@installed_at_exit = true
|
@@installed_at_exit = true
|
||||||
end
|
end
|
||||||
@ -657,9 +665,10 @@ module MiniTest
|
|||||||
inst._assertions = 0
|
inst._assertions = 0
|
||||||
|
|
||||||
print "#{suite}##{method} = " if @verbose
|
print "#{suite}##{method} = " if @verbose
|
||||||
start_time = Time.now
|
|
||||||
|
@start_time = Time.now
|
||||||
result = inst.run self
|
result = inst.run self
|
||||||
time = Time.now - start_time
|
time = Time.now - @start_time
|
||||||
|
|
||||||
print "%.2f s = " % time if @verbose
|
print "%.2f s = " % time if @verbose
|
||||||
print result
|
print result
|
||||||
@ -802,7 +811,7 @@ module MiniTest
|
|||||||
|
|
||||||
def run runner
|
def run runner
|
||||||
trap "INFO" do
|
trap "INFO" do
|
||||||
time = Time.now - runner.start_time
|
time = runner.start_time ? Time.now - runner.start_time : 0
|
||||||
warn "%s#%s %.2fs" % [self.class, self.__name__, time]
|
warn "%s#%s %.2fs" % [self.class, self.__name__, time]
|
||||||
runner.status $stderr
|
runner.status $stderr
|
||||||
end if SUPPORTS_INFO_SIGNAL
|
end if SUPPORTS_INFO_SIGNAL
|
||||||
|
Loading…
x
Reference in New Issue
Block a user