215 local total_active_lines = 0; |
215 local total_active_lines = 0; |
216 local coverage_file = io.open("reports/coverage_"..fn:gsub("%W+", "_")..".report", "a+"); |
216 local coverage_file = io.open("reports/coverage_"..fn:gsub("%W+", "_")..".report", "a+"); |
217 for line, active in pairs(lines_hit) do |
217 for line, active in pairs(lines_hit) do |
218 if active ~= nil then total_active_lines = total_active_lines + 1; end |
218 if active ~= nil then total_active_lines = total_active_lines + 1; end |
219 if coverage_file then |
219 if coverage_file then |
220 if active == false then coverage_file:write(fn, "|", line, "|", name or "", "|miss\n"); |
220 if active == false then coverage_file:write(fn, "|", line, "|", name or "", "|miss\n"); |
221 else coverage_file:write(fn, "|", line, "|", name or "", "|", tostring(success), "\n"); end |
221 else coverage_file:write(fn, "|", line, "|", name or "", "|", tostring(success), "\n"); end |
222 end |
222 end |
223 end |
223 end |
224 if coverage_file then coverage_file:close(); end |
224 if coverage_file then coverage_file:close(); end |
225 return covered_lines, total_active_lines, lines_hit; |
225 return covered_lines, total_active_lines, lines_hit; |