diff options
| author | Alexander Potapenko <glider@google.com> | 2024-07-18 09:59:28 +0200 |
|---|---|---|
| committer | Alexander Potapenko <glider@google.com> | 2024-07-18 08:26:18 +0000 |
| commit | 7403ec00799d816bf3e082bee0cb577697fbd4ae (patch) | |
| tree | adb054270b1c981e8b1bc1292ff1740c318a979f /pkg/cover | |
| parent | 2d731b03753e65533498bdb83eeab3a0330b9606 (diff) | |
pkg/cover: show the total count in the coverage report
When working with standalone coverage reports, it can be sometimes useful
to see the total count of covered basic blocks. Show it together with the
percentage and the total number of BBs in the kernel (for the sake of
uniformity)
Diffstat (limited to 'pkg/cover')
| -rw-r--r-- | pkg/cover/templates/cover.html | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/pkg/cover/templates/cover.html b/pkg/cover/templates/cover.html index 6e7bf458b..0c7f46419 100644 --- a/pkg/cover/templates/cover.html +++ b/pkg/cover/templates/cover.html @@ -94,6 +94,18 @@ .active { display: block; } + .total-left { + padding-left: 16px; + } + .total { + float: right; + width: 250px; + padding-right: 4px; + } + .total-right { + float: right; + } + </style> </head> <body> @@ -101,6 +113,12 @@ <ul id="dir_list"> {{template "dir" .Root}} </ul> + <br /> + <hr /> + <div id="total_coverage"> + <span class="total-left">Total coverage:</span> + <span class="total"> {{.Root.Covered}} ({{.Root.Percent}}%)<span class="total-right">of {{.Root.Total}}</span></span> + </div> </div> <div id="right_pane" class="split right"> <button class="nested" id="close-btn" onclick="onCloseClick()">X</button> @@ -222,4 +240,4 @@ {{end}} </span></li> {{end}} -{{end}}
\ No newline at end of file +{{end}} |
