1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2013-03-25 05:39:29 +00:00
parent e37f8c0f0b
commit 985deb62eb
2 changed files with 5 additions and 5 deletions

View file

@ -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 file

@ -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")