ruby-changes:27872
From: nobu <ko1@a...>
Date: Mon, 25 Mar 2013 14:39:38 +0900 (JST)
Subject: [ruby-changes:27872] nobu:r39924 (trunk): envutil.rb: signal in Process::Status
nobu 2013-03-25 14:39:29 +0900 (Mon, 25 Mar 2013) New Revision: 39924 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39924 Log: envutil.rb: signal in Process::Status * test/ruby/envutil.rb (assert_ruby_status): show status info. * test/ruby/envutil.rb (Test::Unit::Assertions::FailDesc): use Signal.signame for consistency with Process::Status#inspect. * signal.c (siglist): prefer SIGABRT over SIGIOT in Signal.signame. Modified files: trunk/signal.c trunk/test/ruby/envutil.rb Index: test/ruby/envutil.rb =================================================================== --- test/ruby/envutil.rb (revision 39923) +++ test/ruby/envutil.rb (revision 39924) @@ -220,7 +220,7 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/ruby/envutil.rb#L220 pid = status.pid faildesc = proc do signo = status.termsig - signame = Signal.list.invert[signo] + signame = Signal.signame(signo) sigdesc = "signal #{signo}" if signame sigdesc = "SIG#{signame} (#{sigdesc})" @@ -270,7 +270,7 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/ruby/envutil.rb#L270 def assert_ruby_status(args, test_stdin="", message=nil, opt={}) out, _, status = EnvUtil.invoke_ruby(args, test_stdin, true, :merge_to_stdout, opt) message ||= "ruby exit status is not success:" - assert(status.success?, FailDesc[status, message, out]) + assert(status.success?, FailDesc[status, "#{message} (#{status.inspect})", out]) end ABORT_SIGNALS = Signal.list.values_at(*%w"ILL ABRT BUS SEGV") Index: signal.c =================================================================== --- signal.c (revision 39923) +++ signal.c (revision 39924) @@ -71,12 +71,12 @@ static const struct signals { https://github.com/ruby/ruby/blob/trunk/signal.c#L71 #ifdef SIGTRAP {"TRAP", SIGTRAP}, #endif -#ifdef SIGIOT - {"IOT", SIGIOT}, -#endif #ifdef SIGABRT {"ABRT", SIGABRT}, #endif +#ifdef SIGIOT + {"IOT", SIGIOT}, +#endif #ifdef SIGEMT {"EMT", SIGEMT}, #endif -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/