summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--bootstraptest/runner.rb21
2 files changed, 23 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 984a04b..7a0efbc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
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 '.'