Skip to content

Commit

Permalink
Do not print filetime and file executed statements, when they are def…
Browse files Browse the repository at this point in the history
…ined for no file
  • Loading branch information
ChrisJefferson committed Feb 3, 2016
1 parent bee4370 commit f3a6f8d
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions gap/profiling.gi
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,12 @@ InstallGlobalFunction("OutputAnnotatedCodeCoverageFiles",function(arg)
end;

outputoverviewhtml := function(overview, outdir, haveflame)
local filename, outstream, codecover, i;
local filename, outstream, codecover, i, any_timeexec;

Sort(overview, function(v,w) return v.inname < w.inname; end);

any_timeexec := ForAny(overview, i -> IsBound(i.filetime) and IsBound(i.fileexec) );

filename := Concatenation(outdir, "/index.html");
outstream := OutputTextFile(filename, false);
SetPrintFormattingStatus(outstream, false);
Expand All @@ -405,8 +407,11 @@ InstallGlobalFunction("OutputAnnotatedCodeCoverageFiles",function(arg)
PrintTo(outstream, """<p><a href="flame.svg">Flame Graph</a></p>""");
fi;
PrintTo(outstream, "<table cellspacing='0' cellpadding='0' class=\"sortable\">\n",
"<tr><th>File</th><th>Coverage%</th><th>Executed Lines</th><th>Time</th><th>Statements</th></tr>\n"
);
"<tr><th>File</th><th>Coverage%</th><th>Executed Lines</th>");
if any_timeexec then
PrintTo(outstream, "<th>Time</th><th>Statements</th></tr>");
fi;
PrintTo(outstream, "\n");

for i in overview do
PrintTo(outstream, "<tr>");
Expand All @@ -429,10 +434,12 @@ InstallGlobalFunction("OutputAnnotatedCodeCoverageFiles",function(arg)
PrintTo(outstream, "<td>", i.execlines, "</td>");
fi;

if IsBound(i.filetime) and IsBound(i.fileexec) then
PrintTo(outstream, "<td>",i.filetime, "</td><td>",i.fileexec,"</td>");
else
PrintTo(outstream, "<td>N/A</td><td>N/A</td>");
if any_timeexec then
if IsBound(i.filetime) and IsBound(i.fileexec) then
PrintTo(outstream, "<td>",i.filetime, "</td><td>",i.fileexec,"</td>");
else
PrintTo(outstream, "<td>N/A</td><td>N/A</td>");
fi;
fi;
PrintTo(outstream, "</tr>");
od;
Expand Down

0 comments on commit f3a6f8d

Please sign in to comment.