Recommit "rL366894: [yaml2obj] - Allow custom fields for the SHT_UNDEF sections."
[llvm-complete.git] / test / tools / llvm-cov / sources-specified.test
bloba20fe538529b3e406d4fa2f62654e5138e0d49a5
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 # Order of files may differ, check the total values calculated.
14 REPORT-NOT: {{.*}}abs.h{{.*}}
15 REPORT: {{^}}TOTAL 3{{.*}}72.73%
17 # Order of files may differ, check that there are 3 files and not abs.h.
18 SHOW-NOT: {{.*}}abs.h{{.*}}
19 SHOW: {{.*}}sources_specified{{.*}}
20 SHOW: {{.*}}sources_specified{{.*}}
21 SHOW: {{.*}}sources_specified{{.*}}
24 # Test "export" command. Use a temp .json file as output is a single line.
25 RUN: llvm-cov export -instr-profile %S/Inputs/sources_specified/main.profdata \
26 RUN:   -path-equivalence=/tmp,%S/Inputs \
27 RUN:   %S/Inputs/sources_specified/main.covmapping \
28 RUN:   %S/Inputs/sources_specified/main.cc %S/Inputs/sources_specified/extra \
29 RUN:   > %t.export.json
31 RUN: FileCheck -check-prefix=NO-EXPORT %s < %t.export.json
32 RUN: FileCheck -check-prefix=EXPORT %s < %t.export.json
34 NO-EXPORT-NOT: {{"filename":"(/|\\\\)tmp(/|\\\\)sources_specified(/|\\\\)abs.h"}}
35 EXPORT-DAG: {{"filename":"(/|\\\\)tmp(/|\\\\)sources_specified(/|\\\\)main.cc"}}
36 EXPORT-DAG: {{"filename":"(/|\\\\)tmp(/|\\\\)sources_specified(/|\\\\)extra(/|\\\\)dec.h"}}
37 EXPORT-DAG: {{"filename":"(/|\\\\)tmp(/|\\\\)sources_specified(/|\\\\)extra(/|\\\\)inc.h"}}
39 Instructions for regenerating the test:
41 # cd %S/Inputs/sources_specified
42 cp -r . /tmp/sources_specified
44 clang -mllvm -enable-name-compression=false -fprofile-instr-generate \
45     -fcoverage-mapping /tmp/sources_specified/main.cc -o main
47 LLVM_PROFILE_FILE="main.raw" ./main
48 llvm-profdata merge main.raw -o main.profdata
49 llvm-cov convert-for-testing ./main -o ./main.covmapping
50 rm main main.raw