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

ruby-changes:45588

From: nobu <ko1@a...>
Date: Mon, 20 Feb 2017 19:10:13 +0900 (JST)
Subject: [ruby-changes:45588] nobu:r57661 (trunk): assertions.rb: ignore exit in child

nobu	2017-02-20 19:10:08 +0900 (Mon, 20 Feb 2017)

  New Revision: 57661

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57661

  Log:
    assertions.rb: ignore exit in child
    
    * test/lib/test/unit/assertions.rb (assert_separately): ignore
      SystemExit.  unsuccessful exit still fails an assertion later.

  Modified files:
    trunk/test/lib/test/unit/assertions.rb
Index: test/lib/test/unit/assertions.rb
===================================================================
--- test/lib/test/unit/assertions.rb	(revision 57660)
+++ test/lib/test/unit/assertions.rb	(revision 57661)
@@ -589,14 +589,13 @@ EOT https://github.com/ruby/ruby/blob/trunk/test/lib/test/unit/assertions.rb#L589
           file ||= loc.path
           line ||= loc.lineno
         end
-        line -= 5 # lines until src
         src = <<eom
-# -*- coding: #{src.encoding}; -*-
+# -*- coding: #{line += __LINE__; src.encoding}; -*-
   require #{__dir__.dump};include Test::Unit::Assertions
   END {
     puts [Marshal.dump($!)].pack('m'), "assertions=\#{self._assertions}"
   }
-#{src}
+#{line -= __LINE__; src}
   class Test::Unit::Runner
     @@stop_auto_run = true
   end
@@ -621,7 +620,7 @@ eom https://github.com/ruby/ruby/blob/trunk/test/lib/test/unit/assertions.rb#L620
           else
             res.set_backtrace(caller)
           end
-          raise res
+          raise res unless SystemExit === res
         end
 
         # really is it succeed?

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

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