1 RUN: llvm-cov report -instr-profile %S/Inputs/sources_specified/main.profdata \
2 RUN: -path-equivalence=/tmp,%S/Inputs \
3 RUN: %S/Inputs/sources_specified/main.covmapping \
4 RUN: %S/Inputs/sources_specified/main.cc %S/Inputs/sources_specified/extra \
5 RUN: | FileCheck -check-prefix=REPORT %s
7 RUN: llvm-cov show -instr-profile %S/Inputs/sources_specified/main.profdata \
8 RUN: -path-equivalence=/tmp,%S/Inputs \
9 RUN: %S/Inputs/sources_specified/main.covmapping \
10 RUN: %S/Inputs/sources_specified/main.cc %S/Inputs/sources_specified/extra \
11 RUN: | FileCheck -check-prefix=SHOW %s
13 # Don't include all source files when provided source files are filtered out.
14 RUN: llvm-cov show -instr-profile %S/Inputs/sources_specified/main.profdata \
15 RUN: -path-equivalence=/tmp,%S/Inputs \
16 RUN: %S/Inputs/sources_specified/main.covmapping \
17 RUN: --ignore-filename-regex='.*' \
18 RUN: %S/Inputs/sources_specified/main.cc %S/Inputs/sources_specified/extra \
19 RUN: | FileCheck -allow-empty -check-prefix=IGNORE %s
21 IGNORE-NOT: {{.*}}main.cc{{.*}}
22 IGNORE-NOT: {{.*}}inc.h{{.*}}
23 IGNORE-NOT: {{.*}}dec.h{{.*}}
25 # Order of files may differ, check the total values calculated.
26 REPORT-NOT: {{.*}}abs.h{{.*}}
27 REPORT: {{^}}TOTAL 3{{.*}}72.73%
29 # Order of files may differ, check that there are 3 files and not abs.h.
30 SHOW-NOT: {{.*}}abs.h{{.*}}
31 SHOW: {{.*}}sources_specified{{.*}}
32 SHOW: {{.*}}sources_specified{{.*}}
33 SHOW: {{.*}}sources_specified{{.*}}
36 # Test "export" command. Use a temp .json file as output is a single line.
37 RUN: llvm-cov export -instr-profile %S/Inputs/sources_specified/main.profdata \
38 RUN: -path-equivalence=/tmp,%S/Inputs \
39 RUN: %S/Inputs/sources_specified/main.covmapping \
40 RUN: %S/Inputs/sources_specified/main.cc %S/Inputs/sources_specified/extra \
43 RUN: FileCheck -check-prefix=NO-EXPORT %s < %t.export.json
44 RUN: FileCheck -check-prefix=EXPORT %s < %t.export.json
46 NO-EXPORT-NOT: {{"filename":"(/|\\\\)tmp(/|\\\\)sources_specified(/|\\\\)abs.h"}}
47 EXPORT-DAG: {{"filename":"(/|\\\\)tmp(/|\\\\)sources_specified(/|\\\\)main.cc"}}
48 EXPORT-DAG: {{"filename":"(/|\\\\)tmp(/|\\\\)sources_specified(/|\\\\)extra(/|\\\\)dec.h"}}
49 EXPORT-DAG: {{"filename":"(/|\\\\)tmp(/|\\\\)sources_specified(/|\\\\)extra(/|\\\\)inc.h"}}
51 Instructions for regenerating the test:
53 # cd %S/Inputs/sources_specified
54 cp -r . /tmp/sources_specified
56 clang -mllvm -enable-name-compression=false -fprofile-instr-generate \
57 -fcoverage-mapping /tmp/sources_specified/main.cc -o main
59 LLVM_PROFILE_FILE="main.raw" ./main
60 llvm-profdata merge main.raw -o main.profdata
61 llvm-cov convert-for-testing ./main -o ./main.covmapping