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

envutil.rb: check termsig

* test/ruby/envutil.rb (assert_separately): check also terminating
  signal not only if core dumped.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-02-08 07:08:32 +00:00
parent 70fc27b7fa
commit 49c5a3da6f
2 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Fri Feb 8 16:08:28 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* test/ruby/envutil.rb (assert_separately): check also terminating
signal not only if core dumped.
Fri Feb 8 13:12:04 2013 Eric Hodel <drbrain@segment7.net>
* lib/rdoc/generator/darkfish.rb: Set encoding on output template to

View file

@ -249,6 +249,8 @@ module Test
assert(status.success?, m)
end
ABORT_SIGNALS = Signal.list.values_at(*%w"ILL ABRT BUS SEGV")
def assert_separately(args, file = nil, line = nil, src, **opt)
unless file and line
loc, = caller_locations(1,1)
@ -261,8 +263,9 @@ module Test
puts [Marshal.dump($!)].pack('m'), "assertions=\#{self._assertions}"
end
eom
stdout, _stderr, status = EnvUtil.invoke_ruby(args, src, true, true, opt)
assert(!status.coredump?, FailDesc[status])
stdout, stderr, status = EnvUtil.invoke_ruby(args, src, true, true, opt)
abort = status.coredump? || (status.signaled? && ABORT_SIGNALS.include?(status.termsig))
assert(!abort, FailDesc[status, stderr])
self._assertions += stdout[/^assertions=(\d+)/, 1].to_i
res = Marshal.load(stdout.unpack("m")[0])
return unless res