1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* bootstraptest/runner.rb (assert_normal_exit): hide stderr output

when success.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-06-11 03:16:28 +00:00
parent 8ec04b569e
commit 2dc5f35a3a
2 changed files with 23 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Wed Jun 11 12:15:17 2008 Tanaka Akira <akr@fsij.org>
* bootstraptest/runner.rb (assert_normal_exit): hide stderr output
when success.
Wed Jun 11 09:26:43 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* common.mk (encs): need to pass miniruby path for windows.

View file

@ -193,15 +193,30 @@ def assert_normal_exit(testsrc, message = '')
$stderr.puts "\##{@count} #{@location}" if @verbose
faildesc = nil
filename = make_srcfile(testsrc)
`#{@ruby} -W0 #{filename}`
if $?.signaled?
signo = $?.termsig
old_stderr = $stderr.dup
begin
$stderr.reopen("assert_normal_exit_stderr.log", "w")
`#{@ruby} -W0 #{filename}`
status = $?
ensure
$stderr.reopen(old_stderr)
old_stderr.close
end
if status.signaled?
signo = status.termsig
signame = Signal.list.invert[signo]
sigdesc = "signal #{signo}"
if signame
sigdesc = "SIG#{signame} (#{sigdesc})"
end
faildesc = pretty(testsrc, "killed by #{sigdesc}", nil)
stderr_log = File.read("assert_normal_exit_stderr.log")
if !stderr_log.empty?
faildesc << "\n" if /\n\z/ !~ faildesc
stderr_log << "\n" if /\n\z/ !~ stderr_log
stderr_log.gsub!(/^.*\n/) { '| ' + $& }
faildesc << stderr_log
end
end
if !faildesc
$stderr.print '.'