From ea5c795cfd14d5a6c32ce249e82d39f6590c311e Mon Sep 17 00:00:00 2001 From: mgcaret Date: Mon, 6 Jan 2020 12:30:09 -0800 Subject: [PATCH] improve coverage counting --- platforms/GoSXB/run-tests.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/platforms/GoSXB/run-tests.rb b/platforms/GoSXB/run-tests.rb index acecb53..0088e24 100755 --- a/platforms/GoSXB/run-tests.rb +++ b/platforms/GoSXB/run-tests.rb @@ -115,6 +115,7 @@ def run_suite(suite, outfile = nil) outfile.write(outbuf.string) if outfile prevline = "" outbuf.string.lines.each do |line| + cs_line = line.gsub(/\\.+$/,'') case line when /Exception/, /Def not found/, /Stack u/ STDERR.puts prevline, line @@ -125,16 +126,16 @@ def run_suite(suite, outfile = nil) errors += 1 end when /TESTING/i - puts line unless line.start_with?(':') + puts line unless line.start_with?(':') || line.start_with?('\\') end - if line =~ /\s*:\s+(\S+)/ + if cs_line =~ /\s*:\s+(\S+)/ colons[$1.downcase] = true end - if line =~ /\s*[tT]\{\s+:\s+(\S+)/ + if cs_line =~ /\s*[tT]\{\s+:\s+(\S+)/ colons[$1.downcase] = true end - if line =~ /T\{(.+) \}T/ - words = $1.split + if cs_line =~ /T\{\s+(.+)\s+\}T/i + words = $1.split(/\s+/) words.each do |word| next if word == '->' @coverage[word.downcase] += 1 unless colons[word.downcase]