From 790baeed37073052cd1788170ed495a40ac4d646 Mon Sep 17 00:00:00 2001 From: Max Moroz Date: Wed, 31 Jan 2018 17:37:21 +0000 Subject: [PATCH] [llvm-cov] Improvements for summary report generated in HTML format. Summary: This commit adds the following changes: 1) coverage numbers are aligned to the left and padded with spaces in order to provide better readability for percentage values, e.g.: ``` file1 | 89.13% (123 / 2323) | 100.00% (55 / 55) | 9.33% (14545 / 234234) file_asda | 1.78% ( 23 / 4323) | 32.31% (555 / 6555) | 67.89% (1545 / 2234) fileXXX | 100.00% (12323 / 12323) | 100.00% (555 / 555) | 100.00% (12345 / 12345) ``` 2) added "hover" attribute to CSS for highlighting table row under mouse cursor see screenshot attached to the phabricator review page {F5764813} 3) table title row and "totals" row now use bold text Reviewers: vsk, morehouse Reviewed By: vsk Subscribers: kcc, llvm-commits Differential Revision: https://reviews.llvm.org/D42093 llvm-svn: 323892 --- .../llvm-cov/hideUnexecutedSubviews.test | 10 ++-- .../llvm-cov/showLineExecutionCounts.cpp | 11 ++-- llvm/test/tools/llvm-cov/style.test | 10 +++- .../tools/llvm-cov/SourceCoverageViewHTML.cpp | 53 +++++++++++++------ 4 files changed, 58 insertions(+), 26 deletions(-) diff --git a/llvm/test/tools/llvm-cov/hideUnexecutedSubviews.test b/llvm/test/tools/llvm-cov/hideUnexecutedSubviews.test index e972a19d58c6..b3fc1e63bcde 100644 --- a/llvm/test/tools/llvm-cov/hideUnexecutedSubviews.test +++ b/llvm/test/tools/llvm-cov/hideUnexecutedSubviews.test @@ -11,11 +11,11 @@ FILE-NOT: Unexecuted instantiation RUN: FileCheck -check-prefix=INDEX %s -input-file %t.html.dir/index.html -INDEX: Filename -INDEX: Function Coverage -INDEX: Instantiation Coverage -INDEX: Line Coverage -INDEX: Region Coverage +INDEX: Filename +INDEX: Function Coverage +INDEX: Instantiation Coverage +INDEX: Line Coverage +INDEX: Region Coverage INDEX: INDEX: 50.00% (1/2) INDEX: diff --git a/llvm/test/tools/llvm-cov/showLineExecutionCounts.cpp b/llvm/test/tools/llvm-cov/showLineExecutionCounts.cpp index c18afedf034a..7fc36a7a911e 100644 --- a/llvm/test/tools/llvm-cov/showLineExecutionCounts.cpp +++ b/llvm/test/tools/llvm-cov/showLineExecutionCounts.cpp @@ -62,10 +62,10 @@ int main() { // TEXT: [[@LINE]]| 161|int main( // // RUN: FileCheck -check-prefix HTML-INDEX -input-file %t.html.dir/index.html %s // HTML-INDEX-LABEL: -// HTML-INDEX: -// HTML-INDEX: -// HTML-INDEX: -// HTML-INDEX: +// HTML-INDEX: +// HTML-INDEX: +// HTML-INDEX: +// HTML-INDEX: // HTML-INDEX: // HTML-INDEX: +// HTML-INDEX: Totals diff --git a/llvm/test/tools/llvm-cov/style.test b/llvm/test/tools/llvm-cov/style.test index 202bc9de1461..735050e1de30 100644 --- a/llvm/test/tools/llvm-cov/style.test +++ b/llvm/test/tools/llvm-cov/style.test @@ -19,15 +19,23 @@ STYLE-DAG: .centered STYLE-DAG: .expansion-view STYLE-DAG: .line-number STYLE-DAG: .light-row +STYLE-DAG: .light-row-bold STYLE-DAG: .column-entry -STYLE-DAG: .column-entry-left +STYLE-DAG: .column-entry-bold STYLE-DAG: .column-entry-yellow +STYLE-DAG: .column-entry-yellow:hover STYLE-DAG: .column-entry-red +STYLE-DAG: .column-entry-red:hover STYLE-DAG: .column-entry-green +STYLE-DAG: .column-entry-green:hover STYLE-DAG: .covered-line STYLE-DAG: .uncovered-line STYLE-DAG: .tooltip STYLE-DAG: .tooltip span.tooltip-content +STYLE-DAG: th, td +STYLE-DAG: td:first-child +STYLE-DAG: td:last-child +STYLE-DAG: tr:hover TOPLEVEL-NOT:
FilenameFunction CoverageLine CoverageRegion CoverageFilenameFunction CoverageLine CoverageRegion Coverage // HTML-INDEX: 100.00% (1/1) @@ -73,4 +73,5 @@ int main() { // TEXT: [[@LINE]]| 161|int main( // HTML-INDEX: 90.00% (18/20) // HTML-INDEX: // HTML-INDEX: 72.73% (8/11) -// HTML-INDEX: TOTALS +// HTML-INDEX: