From 985deb62ebb0b6d5ca6f3b6469b5860d00869d93 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 25 Mar 2013 05:39:29 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- signal.c | 6 +++--- test/ruby/envutil.rb | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/signal.c b/signal.c index c29a3fbc42..6f6b5452a9 100644 --- a/signal.c +++ b/signal.c @@ -71,12 +71,12 @@ static const struct signals { #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 diff --git a/test/ruby/envutil.rb b/test/ruby/envutil.rb index 80e43346d9..9ff414c367 100644 --- a/test/ruby/envutil.rb +++ b/test/ruby/envutil.rb @@ -220,7 +220,7 @@ module Test 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 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")