summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-06 20:52:25 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-06 20:52:25 +0900
commitf1c230f18ba651ce7bd8e8c621ba4282c5b445db (patch)
tree998eec9ae58c357b2ad0db42a3a6e7a35069993f /tool
parent739fdb7ff0767ae4a666ca83f61e807c0c6c7115 (diff)
Add separated assertion count
Diffstat (limited to 'tool')
-rw-r--r--tool/lib/test/unit/core_assertions.rb19
1 files changed, 10 insertions, 9 deletions
diff --git a/tool/lib/test/unit/core_assertions.rb b/tool/lib/test/unit/core_assertions.rb
index 3eecf45ace..edaf83938f 100644
--- a/tool/lib/test/unit/core_assertions.rb
+++ b/tool/lib/test/unit/core_assertions.rb
@@ -131,20 +131,21 @@ eom
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