From f3a6f8dc91572b6531d1496d230475679fdf5668 Mon Sep 17 00:00:00 2001 From: Chris Jefferson Date: Wed, 3 Feb 2016 18:44:26 +0000 Subject: [PATCH] Do not print filetime and file executed statements, when they are defined for no file --- gap/profiling.gi | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/gap/profiling.gi b/gap/profiling.gi index 5e9d630..7bd615d 100644 --- a/gap/profiling.gi +++ b/gap/profiling.gi @@ -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); @@ -405,8 +407,11 @@ InstallGlobalFunction("OutputAnnotatedCodeCoverageFiles",function(arg) PrintTo(outstream, """

Flame Graph

"""); fi; PrintTo(outstream, "\n", - "\n" - ); + ""); + if any_timeexec then + PrintTo(outstream, ""); + fi; + PrintTo(outstream, "\n"); for i in overview do PrintTo(outstream, ""); @@ -429,10 +434,12 @@ InstallGlobalFunction("OutputAnnotatedCodeCoverageFiles",function(arg) PrintTo(outstream, ""); fi; - if IsBound(i.filetime) and IsBound(i.fileexec) then - PrintTo(outstream, ""); - else - PrintTo(outstream, ""); + if any_timeexec then + if IsBound(i.filetime) and IsBound(i.fileexec) then + PrintTo(outstream, ""); + else + PrintTo(outstream, ""); + fi; fi; PrintTo(outstream, ""); od;
FileCoverage%Executed LinesTimeStatements
FileCoverage%Executed LinesTimeStatements
", i.execlines, "",i.filetime, "",i.fileexec,"N/AN/A",i.filetime, "",i.fileexec,"N/AN/A