Skip to content
Browse files

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
  • Loading branch information...
1 parent e37f8c0 commit 985deb62ebb0b6d5ca6f3b6469b5860d00869d93 @nobu nobu committed Mar 25, 2013
Showing with 5 additions and 5 deletions.
  1. +3 −3 signal.c
  2. +2 −2 test/ruby/envutil.rb
View
6 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
View
4 test/ruby/envutil.rb
@@ -220,7 +220,7 @@ def assert_normal_exit(testsrc, message = '', opt = {})
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 @@ def assert_in_out_err(args, test_stdin = "", test_stdout = [], test_stderr = [],
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")

0 comments on commit 985deb6

Please sign in to comment.
Something went wrong with that request. Please try again.