[前][次][番号順一覧][スレッド一覧]

ruby-changes:40893

From: nobu <ko1@a...>
Date: Wed, 9 Dec 2015 01:17:32 +0900 (JST)
Subject: [ruby-changes:40893] nobu:r52972 (trunk): envutil.rb: improve message

nobu	2015-12-09 01:17:17 +0900 (Wed, 09 Dec 2015)

  New Revision: 52972

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52972

  Log:
    envutil.rb: improve message
    
    * test/lib/envutil.rb (assert_ruby_status): show also outputs at
      normal exit.

  Modified files:
    trunk/test/lib/envutil.rb
Index: test/lib/envutil.rb
===================================================================
--- test/lib/envutil.rb	(revision 52971)
+++ test/lib/envutil.rb	(revision 52972)
@@ -328,6 +328,7 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/lib/envutil.rb#L328
             full_message << message << "\n"
           end
           full_message << "pid #{pid}"
+          full_message << " exit #{status.exitstatus}" if status.exited?
           full_message << " killed by #{sigdesc}" if sigdesc
           if out and !out.empty?
             full_message << "\n#{out.b.gsub(/^/, '| ')}"
@@ -370,9 +371,10 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/lib/envutil.rb#L371
 
       def assert_ruby_status(args, test_stdin="", message=nil, **opt)
         out, _, status = EnvUtil.invoke_ruby(args, test_stdin, true, :merge_to_stdout, **opt)
-        assert(!status.signaled?, FailDesc[status, message, out])
+        desc = FailDesc[status, message, out]
+        assert(!status.signaled?, desc)
         message ||= "ruby exit status is not success:"
-        assert(status.success?, "#{message} (#{status.inspect})")
+        assert(status.success?, desc)
       end
 
       ABORT_SIGNALS = Signal.list.values_at(*%w"ILL ABRT BUS SEGV TERM")

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]