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

ruby-changes:59937

From: Nobuyoshi <ko1@a...>
Date: Thu, 6 Feb 2020 20:57:42 +0900 (JST)
Subject: [ruby-changes:59937] f1c230f18b (master): Add separated assertion count

https://git.ruby-lang.org/ruby.git/commit/?id=f1c230f18b

From f1c230f18ba651ce7bd8e8c621ba4282c5b445db Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Thu, 6 Feb 2020 20:52:25 +0900
Subject: Add separated assertion count


diff --git a/tool/lib/test/unit/core_assertions.rb b/tool/lib/test/unit/core_assertions.rb
index 3eecf45..edaf839 100644
--- a/tool/lib/test/unit/core_assertions.rb
+++ b/tool/lib/test/unit/core_assertions.rb
@@ -131,20 +131,21 @@ eom https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit/core_assertions.rb#L131
         args = args.dup
         args.insert((Hash === args.first ? 1 : 0), "-w", "--disable=gems", *$:.map {|l| "-I#{l}"})
         stdout, stderr, status = EnvUtil.invoke_ruby(args, src, true, true, **opt)
+        if res_c
+          res_c.close
+          res = res_p.read
+          res_p.close
+        else
+          res = stdout
+        end
         abort = status.coredump? || (status.signaled? && ABORT_SIGNALS.include?(status.termsig))
         assert(!abort, FailDesc[status, nil, stderr])
-        self._assertions += stdout[/^assertions=(\d+)/, 1].to_i
+        self._assertions += res[/^assertions=(\d+)/, 1].to_i
         begin
-          if res_c
-            res_c.close
-            MiniTest::Unit.output.print stdout
-            res = Marshal.load(res_p.read.unpack("m")[0])
-            res_p.close
-          else
-            res = Marshal.load(stdout.unpack("m")[0])
-          end
+          res = Marshal.load(res.unpack1("m"))
         rescue => marshal_error
           ignore_stderr = nil
+          res = nil
         end
         if res
           if bt = res.backtrace
-- 
cgit v0.10.2


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

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