[Frontend] Remove unused includes (NFC) (#116927)
[llvm-project.git] / llvm / test / tools / llvm-cov / multithreaded-report.test
blob4a69826c3b96d7969f0705974d511a4945a88809
1 # Test "report" command with and without multiple threads.
3 RUN: llvm-cov report -num-threads=1 \
4 RUN:   -path-equivalence=/tmp,%S/Inputs \
5 RUN:   -instr-profile %S/Inputs/multithreaded_report/main.profdata \
6 RUN:   %S/Inputs/multithreaded_report/main.covmapping > %t.1.report
8 RUN: llvm-cov report -num-threads=10 \
9 RUN:   -path-equivalence=/tmp,%S/Inputs \
10 RUN:   -instr-profile %S/Inputs/multithreaded_report/main.profdata \
11 RUN:   %S/Inputs/multithreaded_report/main.covmapping > %t.2.report
13 RUN: diff %t.1.report %t.2.report
15 # Test "export" command with and without multiple threads.
16 RUN: llvm-cov export -num-threads=1 \
17 RUN:   -path-equivalence=/tmp,%S/Inputs \
18 RUN:   -instr-profile %S/Inputs/multithreaded_report/main.profdata \
19 RUN:   %S/Inputs/multithreaded_report/main.covmapping > %t.1.json
21 RUN: llvm-cov export -num-threads=10 \
22 RUN:   -path-equivalence=/tmp,%S/Inputs \
23 RUN:   -instr-profile %S/Inputs/multithreaded_report/main.profdata \
24 RUN:   %S/Inputs/multithreaded_report/main.covmapping > %t.2.json
26 RUN: diff %t.1.json %t.2.json
28 # Test "show" command with and without multiple threads, single text file.
29 RUN: llvm-cov show -format=text -num-threads=1 \
30 RUN:   -path-equivalence=/tmp,%S/Inputs \
31 RUN:   -instr-profile %S/Inputs/multithreaded_report/main.profdata \
32 RUN:   %S/Inputs/multithreaded_report/main.covmapping > %t.1.text
34 RUN: llvm-cov show -format=text -num-threads=10 \
35 RUN:   -path-equivalence=/tmp,%S/Inputs \
36 RUN:   -instr-profile %S/Inputs/multithreaded_report/main.profdata \
37 RUN:   %S/Inputs/multithreaded_report/main.covmapping > %t.2.text
39 RUN: diff %t.1.text %t.2.text
41 # Test "show" command with and without multiple threads, single HTML file.
42 RUN: llvm-cov show -format=html -num-threads=1 \
43 RUN:   -path-equivalence=/tmp,%S/Inputs \
44 RUN:   -instr-profile %S/Inputs/multithreaded_report/main.profdata \
45 RUN:   %S/Inputs/multithreaded_report/main.covmapping > %t.1.html
47 RUN: llvm-cov show -format=html -num-threads=10 \
48 RUN:   -path-equivalence=/tmp,%S/Inputs \
49 RUN:   -instr-profile %S/Inputs/multithreaded_report/main.profdata \
50 RUN:   %S/Inputs/multithreaded_report/main.covmapping > %t.2.html
52 RUN: diff %t.1.html %t.2.html 
54 # Test "show" command with and without multiple threads, text directory.
55 RUN: llvm-cov show -format=text -num-threads=1 \
56 RUN:   -path-equivalence=/tmp,%S/Inputs \
57 RUN:   -instr-profile %S/Inputs/multithreaded_report/main.profdata \
58 RUN:   %S/Inputs/multithreaded_report/main.covmapping -o %t.1.text_dir
60 RUN: llvm-cov show -format=text -num-threads=10 \
61 RUN:   -path-equivalence=/tmp,%S/Inputs \
62 RUN:   -instr-profile %S/Inputs/multithreaded_report/main.profdata \
63 RUN:   %S/Inputs/multithreaded_report/main.covmapping -o %t.2.text_dir
65 RUN: diff -r %t.1.text_dir %t.2.text_dir
67 # Test "show" command with and without multiple threads, HTML directory.
68 RUN: llvm-cov show -format=html -num-threads=1 \
69 RUN:   -path-equivalence=/tmp,%S/Inputs \
70 RUN:   -instr-profile %S/Inputs/multithreaded_report/main.profdata \
71 RUN:   %S/Inputs/multithreaded_report/main.covmapping -o %t.1.html_dir
73 RUN: llvm-cov show -format=html -num-threads=10 \
74 RUN:   -path-equivalence=/tmp,%S/Inputs \
75 RUN:   -instr-profile %S/Inputs/multithreaded_report/main.profdata \
76 RUN:   %S/Inputs/multithreaded_report/main.covmapping -o %t.2.html_dir
78 RUN: diff -r %t.1.html_dir %t.2.html_dir
81 Instructions for regenerating the test:
83 # cd %S/Inputs/multithreaded_report
85 cp -r . /tmp/multithreaded_report
87 clang++ -std=c++11 -mllvm -enable-name-compression=false \
88     -fprofile-instr-generate -fcoverage-mapping \
89     /tmp/multithreaded_report/*.cc -o main
91 LLVM_PROFILE_FILE="main.profraw" ./main
92 llvm-profdata merge main.profraw -o main.profdata
93 llvm-cov convert-for-testing ./main -o ./main.covmapping
94 rm main main.profraw