mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 13:04:13 +02:00
* test/ruby/envutil.rb (assert_separately): stop_auto_run of
Test::Unit::Runner to prevent auto runner use ARGV. * test/ruby/envutil.rb (assert_separately): add $: to separate process. * test/ruby/envutil.rb (assert_separately): fail if stderr is not empty and ignore_stderr is false. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
63f33c5e46
commit
a26d663b70
2 changed files with 28 additions and 4 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
Tue Apr 2 15:22:09 2013 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* test/ruby/envutil.rb (assert_separately): stop_auto_run of
|
||||||
|
Test::Unit::Runner to prevent auto runner use ARGV.
|
||||||
|
|
||||||
|
* test/ruby/envutil.rb (assert_separately): add $: to separate process.
|
||||||
|
|
||||||
|
* test/ruby/envutil.rb (assert_separately): fail if stderr is not
|
||||||
|
empty and ignore_stderr is false.
|
||||||
|
|
||||||
Tue Apr 2 06:46:59 2013 Tanaka Akira <akr@fsij.org>
|
Tue Apr 2 06:46:59 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* ext/-test-/num2int/num2int.c: Rename utility methods
|
* ext/-test-/num2int/num2int.c: Rename utility methods
|
||||||
|
|
|
@ -287,17 +287,31 @@ module Test
|
||||||
ensure
|
ensure
|
||||||
puts [Marshal.dump($!)].pack('m'), "assertions=\#{self._assertions}"
|
puts [Marshal.dump($!)].pack('m'), "assertions=\#{self._assertions}"
|
||||||
end
|
end
|
||||||
|
class Test::Unit::Runner
|
||||||
|
@@stop_auto_run = true
|
||||||
|
end
|
||||||
eom
|
eom
|
||||||
|
args = args.dup
|
||||||
|
$:.each{|l| args.unshift "-I#{l}" }
|
||||||
|
ignore_stderr = opt.delete(:ignore_stderr)
|
||||||
stdout, stderr, status = EnvUtil.invoke_ruby(args, src, true, true, opt)
|
stdout, stderr, status = EnvUtil.invoke_ruby(args, src, true, true, opt)
|
||||||
abort = status.coredump? || (status.signaled? && ABORT_SIGNALS.include?(status.termsig))
|
abort = status.coredump? || (status.signaled? && ABORT_SIGNALS.include?(status.termsig))
|
||||||
assert(!abort, FailDesc[status, stderr])
|
assert(!abort, FailDesc[status, stderr])
|
||||||
self._assertions += stdout[/^assertions=(\d+)/, 1].to_i
|
self._assertions += stdout[/^assertions=(\d+)/, 1].to_i
|
||||||
res = Marshal.load(stdout.unpack("m")[0])
|
res = Marshal.load(stdout.unpack("m")[0])
|
||||||
return unless res
|
if res
|
||||||
res.backtrace.each do |l|
|
res.backtrace.each do |l|
|
||||||
l.sub!(/\A-:(\d+)/){"#{file}:#{line + $1.to_i}"}
|
l.sub!(/\A-:(\d+)/){"#{file}:#{line + $1.to_i}"}
|
||||||
|
end
|
||||||
|
raise res
|
||||||
end
|
end
|
||||||
raise res
|
|
||||||
|
# really is it succeed?
|
||||||
|
unless ignore_stderr
|
||||||
|
# the body of assert_separately must not output anything to detect errror
|
||||||
|
assert_equal("", stderr, "assert_separately failed with error message")
|
||||||
|
end
|
||||||
|
assert_equal(0, status, "assert_separately failed: '#{stderr}'")
|
||||||
end
|
end
|
||||||
|
|
||||||
def assert_warning(pat, msg = nil)
|
def assert_warning(pat, msg = nil)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue