From eebd08c34df2cc1c317be9d0db1ff91926b26833 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 27 Jan 2026 23:49:39 -0500 Subject: [PATCH] Fix SimpleCov coverage results for multiple invocations from same build test --- build_tests/build_tests.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build_tests/build_tests.rb b/build_tests/build_tests.rb index 63e4cd1..4d846f2 100644 --- a/build_tests/build_tests.rb +++ b/build_tests/build_tests.rb @@ -26,6 +26,7 @@ class Test @block = block @coverage_dir = "#{OWD}/coverage/#{@name}" @output = "" + @invocation = 0 end def run(outfh) @@ -84,6 +85,7 @@ class Test end def run_rscons(options = {}) + @invocation += 1 args = Array(options[:args]) || [] if ENV["dist_specs"] exe = "#{OWD}/test_run/rscons.rb" @@ -104,7 +106,7 @@ end SimpleCov.start do root(#{OWD.inspect}) coverage_dir(#{@coverage_dir.inspect}) - command_name "#{@name}" + command_name "#{@name}_#{@invocation}" filters.clear add_filter do |src| !(src.filename[SimpleCov.root])