Skip to content

Commit

Permalink
envutil.rb: signal in Process::Status
Browse files Browse the repository at this point in the history
* 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
nobu committed Mar 25, 2013
1 parent 8032111 commit cf77a67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions signal.c
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/ruby/envutil.rb
Expand Up @@ -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})"
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit cf77a67

Please sign in to comment.