diff --git a/llvm/test/tools/llvm-cov/coverage_watermark.test b/llvm/test/tools/llvm-cov/coverage_watermark.test new file mode 100644 --- /dev/null +++ b/llvm/test/tools/llvm-cov/coverage_watermark.test @@ -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: +ORIGIN: 100.00% (3/3) +ORIGIN: +ORIGIN: 75.00% (9/12) +ORIGIN: +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: +DOWNGRADE1: 100.00% (3/3) +DOWNGRADE1: +DOWNGRADE1: 75.00% (9/12) +DOWNGRADE1: +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: +DOWNGRADE2: 100.00% (3/3) +DOWNGRADE2: +DOWNGRADE2: 75.00% (9/12) +DOWNGRADE2: +DOWNGRADE2: 66.67% (4/6)