summaryrefslogtreecommitdiff
path: root/bootstraptest/runner.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-11 03:16:28 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-11 03:16:28 +0000
commit2dc5f35a3a1baabeed4d13bfee1ee6b504d45cf9 (patch)
tree49e3a74a489c9660799e7bab6a132c0cac37b49a /bootstraptest/runner.rb
parent8ec04b569e49a082262d6c877519babc184f263f (diff)
* 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
Diffstat (limited to 'bootstraptest/runner.rb')
-rw-r--r--bootstraptest/runner.rb21
1 files changed, 18 insertions, 3 deletions
diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb
index 5eea6b6..931fb46 100644
--- a/bootstraptest/runner.rb
+++ b/bootstraptest/runner.rb
@@ -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 '.'