[llvm] [llvm-cov] format cells in code coverage report with 0/0 branches/functions/lines differently + adding sorting of the report table (PR #75780)

Hana Dusíková via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 19 01:31:02 PST 2023


================
@@ -13,29 +13,47 @@ INVALID-ARRANGE: error: -coverage-watermark: invalid number range '10,20', must
 RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -format html -show-region-summary -show-instantiation-summary -o %t.html.dir -path-equivalence=/tmp,%S %S/showTemplateInstantiations.cpp
 RUN: FileCheck -check-prefix=ORIGIN %s -input-file %t.html.dir/index.html
 
+ORIGIN: Totals
+ORIGIN: <td class='column-entry-green'>
+ORIGIN: 100.00% (2/2)
 ORIGIN: <td class='column-entry-green'>
 ORIGIN: 100.00% (3/3)
 ORIGIN: <td class='column-entry-red'>
 ORIGIN: 75.00% (9/12)
 ORIGIN: <td class='column-entry-red'>
 ORIGIN: 66.67% (4/6)
+ORIGIN: <td class='column-entry-gray'>
+ORIGIN: - (0/0)
+ORIGIN: </tr>
 
-RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -format html -show-region-summary -show-instantiation-summary -o %t.html.dir -path-equivalence=/tmp,%S -coverage-watermark 80,60 %S/showTemplateInstantiations.cpp
+RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -format html -show-region-summary -show-instantiation-summary -o %t.html.dir -path-equivalence=/tmp,%S -coverage-watermark 80,70 %S/showTemplateInstantiations.cpp
 RUN: FileCheck -check-prefix=DOWNGRADE1 %s -input-file %t.html.dir/index.html
 
+DOWNGRADE:1 Totals
+DOWNGRADE1: <td class='column-entry-green'>
+DOWNGRADE1: 100.00% (2/2)
 DOWNGRADE1: <td class='column-entry-green'>
 DOWNGRADE1: 100.00% (3/3)
 DOWNGRADE1: <td class='column-entry-yellow'>
 DOWNGRADE1: 75.00% (9/12)
 DOWNGRADE1: <td class='column-entry-red'>
 DOWNGRADE1: 66.67% (4/6)
+DOWNGRADE1: <td class='column-entry-gray'>
+DOWNGRADE1: - (0/0)
+DOWNGRADE1: </tr>
----------------
hanickadot wrote:

previously the red was actually the - (0/0), so I changed the threshold and make the test more precise

https://github.com/llvm/llvm-project/pull/75780


More information about the llvm-commits mailing list