[前][次][番号順一覧][スレッド一覧]

ruby-changes:27103

From: nobu <ko1@a...>
Date: Fri, 8 Feb 2013 16:12:26 +0900 (JST)
Subject: [ruby-changes:27103] nobu:r39155 (trunk): envutil.rb: check termsig

nobu	2013-02-08 16:08:32 +0900 (Fri, 08 Feb 2013)

  New Revision: 39155

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39155

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

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/envutil.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39154)
+++ ChangeLog	(revision 39155)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Feb  8 16:08:28 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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@s...>
 
 	* lib/rdoc/generator/darkfish.rb:  Set encoding on output template to
Index: test/ruby/envutil.rb
===================================================================
--- test/ruby/envutil.rb	(revision 39154)
+++ test/ruby/envutil.rb	(revision 39155)
@@ -249,6 +249,8 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/ruby/envutil.rb#L249
         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 https://github.com/ruby/ruby/blob/trunk/test/ruby/envutil.rb#L263
     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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]