diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-28 08:51:41 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-28 08:51:41 +0000 |
commit | 43ce5ce1b46707bdd0e5a8a3a7b536530da6d7fa (patch) | |
tree | 69b911674b628b750c877cdb08191116e76a8a70 /test/ruby/envutil.rb | |
parent | ea632a6daabfc9acb01186a860ac9e66d6206bab (diff) | |
download | ruby-43ce5ce1b46707bdd0e5a8a3a7b536530da6d7fa.tar.gz |
envutil.rb: no core dump
* test/ruby/envutil.rb (assert_separately): imply no core dump.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/envutil.rb')
-rw-r--r-- | test/ruby/envutil.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/test/ruby/envutil.rb b/test/ruby/envutil.rb index 34963df653..b640dcd124 100644 --- a/test/ruby/envutil.rb +++ b/test/ruby/envutil.rb @@ -189,6 +189,10 @@ module Test child_env = [] end out, _, status = EnvUtil.invoke_ruby(child_env + %W'-W0', testsrc, true, :merge_to_stdout, opt) + assert !status.signaled?, FailDesc[status, message, out] + end + + FailDesc = proc do |status, message = "", out = ""| pid = status.pid faildesc = proc do signo = status.termsig @@ -201,17 +205,17 @@ module Test sigdesc << " (core dumped)" end full_message = '' - if !message.empty? + if message and !message.empty? full_message << message << "\n" end full_message << "pid #{pid} killed by #{sigdesc}" - if !out.empty? - out << "\n" if /\n\z/ !~ out + if out and !out.empty? full_message << "\n#{out.gsub(/^/, '| ')}" + full_message << "\n" if /\n\z/ !~ full_message end full_message end - assert !status.signaled?, faildesc + faildesc end def assert_in_out_err(args, test_stdin = "", test_stdout = [], test_stderr = [], message = nil, opt={}) @@ -257,7 +261,8 @@ module Test puts [Marshal.dump($!)].pack('m'), "assertions=\#{self._assertions}" end eom - stdout, _stderr, _status = EnvUtil.invoke_ruby(args, src, true, true, opt) + stdout, _stderr, status = EnvUtil.invoke_ruby(args, src, true, true, opt) + assert(!status.coredump?, FailDesc[status]) self._assertions += stdout[/^assertions=(\d+)/, 1].to_i res = Marshal.load(stdout.unpack("m")[0]) return unless res |