xref: /llvm-project/llvm/test/tools/llvm-cov/coverage_watermark.test (revision 18e1179208a1bcf561c76cd50460e1a411171736)
1RUN: not llvm-cov show --instr-profile=/dev/null -coverage-watermark=foo /dev/null 2>&1 | FileCheck --check-prefix=INVALID-ARG %s
2INVALID-ARG: error: -coverage-watermark: invalid argument 'foo', must be in format 'high,low'
3
4RUN: not llvm-cov show --instr-profile=/dev/null -coverage-watermark=a,2 /dev/null 2>&1 | FileCheck --check-prefix=INVALID-HIGH %s
5INVALID-HIGH: error: -coverage-watermark: invalid number 'a', invalid value for 'high'
6
7RUN: not llvm-cov show --instr-profile=/dev/null -coverage-watermark=10,b /dev/null 2>&1 | FileCheck --check-prefix=INVALID-LOW %s
8INVALID-LOW: error: -coverage-watermark: invalid number 'b', invalid value for 'low'
9
10RUN: not llvm-cov show --instr-profile=/dev/null -coverage-watermark=10,20 /dev/null 2>&1 | FileCheck --check-prefix=INVALID-ARRANGE %s
11INVALID-ARRANGE: error: -coverage-watermark: invalid number range '10,20', must be both high and low should be between 0-100, and high > low
12
13RUN: 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
14RUN: FileCheck -check-prefix=ORIGIN %s -input-file %t.html.dir/index.html
15
16ORIGIN: Totals
17ORIGIN: <td class='column-entry-green'>
18ORIGIN: 100.00% (2/2)
19ORIGIN: <td class='column-entry-green'>
20ORIGIN: 100.00% (3/3)
21ORIGIN: <td class='column-entry-red'>
22ORIGIN: 75.00% (9/12)
23ORIGIN: <td class='column-entry-red'>
24ORIGIN: 66.67% (4/6)
25ORIGIN: <td class='column-entry-gray'>
26ORIGIN: - (0/0)
27ORIGIN: </tr>
28
29RUN: 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
30RUN: FileCheck -check-prefix=DOWNGRADE1 %s -input-file %t.html.dir/index.html
31
32DOWNGRADE:1 Totals
33DOWNGRADE1: <td class='column-entry-green'>
34DOWNGRADE1: 100.00% (2/2)
35DOWNGRADE1: <td class='column-entry-green'>
36DOWNGRADE1: 100.00% (3/3)
37DOWNGRADE1: <td class='column-entry-yellow'>
38DOWNGRADE1: 75.00% (9/12)
39DOWNGRADE1: <td class='column-entry-red'>
40DOWNGRADE1: 66.67% (4/6)
41DOWNGRADE1: <td class='column-entry-gray'>
42DOWNGRADE1: - (0/0)
43DOWNGRADE1: </tr>
44
45RUN: 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
46RUN: FileCheck -check-prefix=DOWNGRADE2 %s -input-file %t.html.dir/index.html
47
48DOWNGRADE:1 Totals
49DOWNGRADE2: <td class='column-entry-green'>
50DOWNGRADE2: 100.00% (2/2)
51DOWNGRADE2: <td class='column-entry-green'>
52DOWNGRADE2: 100.00% (3/3)
53DOWNGRADE2: <td class='column-entry-green'>
54DOWNGRADE2: 75.00% (9/12)
55DOWNGRADE2: <td class='column-entry-yellow'>
56DOWNGRADE2: 66.67% (4/6)
57DOWNGRADE1: <td class='column-entry-gray'>
58DOWNGRADE1: - (0/0)
59DOWNGRADE1: </tr>
60