ruby-changes:26909
From: nobu <ko1@a...>
Date: Mon, 28 Jan 2013 17:51:52 +0900 (JST)
Subject: [ruby-changes:26909] nobu:r38961 (trunk): envutil.rb: no core dump
nobu 2013-01-28 17:51:41 +0900 (Mon, 28 Jan 2013) New Revision: 38961 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38961 Log: envutil.rb: no core dump * test/ruby/envutil.rb (assert_separately): imply no core dump. Modified files: trunk/ChangeLog trunk/test/ruby/envutil.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 38960) +++ ChangeLog (revision 38961) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon Jan 28 17:51:38 2013 Nobuyoshi Nakada <nobu@r...> + + * test/ruby/envutil.rb (assert_separately): imply no core dump. + Mon Jan 28 12:32:31 2013 Tanaka Akira <akr@f...> * ext/fcntl/fcntl.c: update document. use "file descriptor" instead Index: test/ruby/envutil.rb =================================================================== --- test/ruby/envutil.rb (revision 38960) +++ test/ruby/envutil.rb (revision 38961) @@ -189,6 +189,10 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/ruby/envutil.rb#L189 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/envutil.rb#L205 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/envutil.rb#L261 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/