Fix SimpleCov coverage results for multiple invocations from same build test

This commit is contained in:
josh committed 2026-01-27 23:50:04 -05:00
1 parent baf4e036fb
commit e6317ae236
1 file changed
+3 -1
+3 -1
View File
@@ -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])