multithreaded-report.test
3.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Test "report" command with and without multiple threads.
RUN: llvm-cov report -num-threads=1 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.1.report
RUN: llvm-cov report -num-threads=10 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.2.report
RUN: diff %t.1.report %t.2.report
# Test "export" command with and without multiple threads.
RUN: llvm-cov export -num-threads=1 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.1.json
RUN: llvm-cov export -num-threads=10 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.2.json
RUN: diff %t.1.json %t.2.json
# Test "show" command with and without multiple threads, single text file.
RUN: llvm-cov show -format=text -num-threads=1 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.1.text
RUN: llvm-cov show -format=text -num-threads=10 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.2.text
RUN: diff %t.1.text %t.2.text
# Test "show" command with and without multiple threads, single HTML file.
RUN: llvm-cov show -format=html -num-threads=1 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.1.html
RUN: llvm-cov show -format=html -num-threads=10 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.2.html
RUN: diff %t.1.html %t.2.html
# Test "show" command with and without multiple threads, text directory.
RUN: llvm-cov show -format=text -num-threads=1 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping -o %t.1.text_dir
RUN: llvm-cov show -format=text -num-threads=10 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping -o %t.2.text_dir
RUN: diff -r %t.1.text_dir %t.2.text_dir
# Test "show" command with and without multiple threads, HTML directory.
RUN: llvm-cov show -format=html -num-threads=1 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping -o %t.1.html_dir
RUN: llvm-cov show -format=html -num-threads=10 \
RUN: -path-equivalence=/tmp,%S/Inputs \
RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \
RUN: %S/Inputs/multithreaded_report/main.covmapping -o %t.2.html_dir
RUN: diff -r %t.1.html_dir %t.2.html_dir
Instructions for regenerating the test:
# cd %S/Inputs/multithreaded_report
cp -r . /tmp/multithreaded_report
clang++ -std=c++11 -mllvm -enable-name-compression=false \
-fprofile-instr-generate -fcoverage-mapping \
/tmp/multithreaded_report/*.cc -o main
LLVM_PROFILE_FILE="main.profraw" ./main
llvm-profdata merge main.profraw -o main.profdata
llvm-cov convert-for-testing ./main -o ./main.covmapping
rm main main.profraw