1
0
mirror of https://github.com/mgcaret/of816.git synced 2025-08-15 13:27:28 +00:00

improve coverage counting

This commit is contained in:
mgcaret
2020-01-06 12:30:09 -08:00
parent 9f6f2b441e
commit ea5c795cfd

View File

@@ -115,6 +115,7 @@ def run_suite(suite, outfile = nil)
outfile.write(outbuf.string) if outfile outfile.write(outbuf.string) if outfile
prevline = "" prevline = ""
outbuf.string.lines.each do |line| outbuf.string.lines.each do |line|
cs_line = line.gsub(/\\.+$/,'')
case line case line
when /Exception/, /Def not found/, /Stack u/ when /Exception/, /Def not found/, /Stack u/
STDERR.puts prevline, line STDERR.puts prevline, line
@@ -125,16 +126,16 @@ def run_suite(suite, outfile = nil)
errors += 1 errors += 1
end end
when /TESTING/i when /TESTING/i
puts line unless line.start_with?(':') puts line unless line.start_with?(':') || line.start_with?('\\')
end end
if line =~ /\s*:\s+(\S+)/ if cs_line =~ /\s*:\s+(\S+)/
colons[$1.downcase] = true colons[$1.downcase] = true
end end
if line =~ /\s*[tT]\{\s+:\s+(\S+)/ if cs_line =~ /\s*[tT]\{\s+:\s+(\S+)/
colons[$1.downcase] = true colons[$1.downcase] = true
end end
if line =~ /T\{(.+) \}T/ if cs_line =~ /T\{\s+(.+)\s+\}T/i
words = $1.split words = $1.split(/\s+/)
words.each do |word| words.each do |word|
next if word == '->' next if word == '->'
@coverage[word.downcase] += 1 unless colons[word.downcase] @coverage[word.downcase] += 1 unless colons[word.downcase]