Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llvm-cov] Add test cases for coverage_watermark
Add test cases for coverage_watermark in llvm-cov, also refer to https://reviews.llvm.org/D116876 Differential Revision: https://reviews.llvm.org/D122785
- Loading branch information
1 parent
4b82bb6
commit d17c7cc
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
RUN: not llvm-cov show --instr-profile=/dev/null -coverage-watermark=foo /dev/null 2>&1 | FileCheck --check-prefix=INVALID-ARG %s | ||
INVALID-ARG: error: -coverage-watermark: invalid argument 'foo', must be in format 'high,low' | ||
|
||
RUN: not llvm-cov show --instr-profile=/dev/null -coverage-watermark=a,2 /dev/null 2>&1 | FileCheck --check-prefix=INVALID-HIGH %s | ||
INVALID-HIGH: error: -coverage-watermark: invalid number 'a', invalid value for 'high' | ||
|
||
RUN: not llvm-cov show --instr-profile=/dev/null -coverage-watermark=10,b /dev/null 2>&1 | FileCheck --check-prefix=INVALID-LOW %s | ||
INVALID-LOW: error: -coverage-watermark: invalid number 'b', invalid value for 'low' | ||
|
||
RUN: not llvm-cov show --instr-profile=/dev/null -coverage-watermark=10,20 /dev/null 2>&1 | FileCheck --check-prefix=INVALID-ARRANGE %s | ||
INVALID-ARRANGE: error: -coverage-watermark: invalid number range '10,20', must be both high and low should be between 0-100, and high > low | ||
|
||
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: <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) | ||
|
||
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: FileCheck -check-prefix=DOWNGRADE1 %s -input-file %t.html.dir/index.html | ||
|
||
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) | ||
|
||
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 70,50 %S/showTemplateInstantiations.cpp | ||
RUN: FileCheck -check-prefix=DOWNGRADE2 %s -input-file %t.html.dir/index.html | ||
|
||
DOWNGRADE2: <td class='column-entry-green'> | ||
DOWNGRADE2: 100.00% (3/3) | ||
DOWNGRADE2: <td class='column-entry-green'> | ||
DOWNGRADE2: 75.00% (9/12) | ||
DOWNGRADE2: <td class='column-entry-yellow'> | ||
DOWNGRADE2: 66.67% (4/6) |