1 RUN: llvm-profdata merge %S/Inputs/dir-with-filtering.proftext -o %t.profdata
\r
3 // Test TEXT both files
\r
5 RUN: llvm-cov show %S/Inputs/dir-with-filtering.covmapping -o %t.text -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs -name=main -name=f2
\r
7 RUN: FileCheck -input-file=%t.text/index.txt %s -check-prefix=TEXT-INDEX
\r
8 TEXT-INDEX: dir-with-filtering1.cpp 1 0 100.00% 1 0 100.00% 4 0 100.00%
\r
9 TEXT-INDEX: dir-with-filtering2.cpp 1 1 0.00% 1 1 0.00% 3 3 0.00%
\r
11 RUN: FileCheck -input-file=%t.text/coverage/tmp/dir-with-filtering1.cpp.txt %s -check-prefix=TEXT-FILE1
\r
12 TEXT-FILE1: Coverage Report
\r
13 TEXT-FILE1-NOT: _Z2f1v:
\r
15 TEXT-FILE1-NEXT: {{.*}}int main()
\r
16 TEXT-FILE1-NOT: _Z2f1v:
\r
18 RUN: FileCheck -input-file=%t.text/coverage/tmp/dir-with-filtering2.cpp.txt %s -check-prefix=TEXT-FILE2
\r
19 TEXT-FILE2: Coverage Report
\r
20 TEXT-FILE2-NOT: _Z2f3v:
\r
22 TEXT-FILE2-NEXT: {{.*}}int f2()
\r
23 TEXT-FILE2-NOT: _Z2f3v:
\r
25 // Test TEXT one file
\r
27 RUN: llvm-cov show %S/Inputs/dir-with-filtering.covmapping -o %t.text_one_file -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs -name=main -name=f2 %S/Inputs/dir-with-filtering1.cpp
\r
29 RUN: FileCheck -input-file=%t.text_one_file/index.txt %s -check-prefix=TEXT-INDEX-ONE-FILE
\r
30 TEXT-INDEX-ONE-FILE: dir-with-filtering1.cpp 1 0 100.00% 1 0 100.00% 4 0 100.00%
\r
31 TEXT-INDEX-ONE-FILE-NOT: dir-with-filtering2.cpp
\r
33 RUN: FileCheck -input-file=%t.text_one_file/coverage/tmp/dir-with-filtering1.cpp.txt %s -check-prefix=TEXT-FILE1
\r
35 // Test TEXT index file with all functions in one file filtered out
\r
37 RUN: llvm-cov show %S/Inputs/dir-with-filtering.covmapping -o %t.text_one_func -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs -name=main
\r
38 RUN: FileCheck -input-file=%t.text_one_func/index.txt %s -check-prefix=TEXT-INDEX-ONE-FUNC
\r
40 TEXT-INDEX-ONE-FUNC-NOT: Files which contain no functions
\r
41 TEXT-INDEX-ONE-FUNC-NOT: dir-with-filtering2.cpp
\r
43 // Test HTML both files
\r
45 RUN: llvm-profdata merge %S/Inputs/dir-with-filtering.proftext -o %t.profdata
\r
46 RUN: llvm-cov show %S/Inputs/dir-with-filtering.covmapping -format html -o %t.html -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs -name=main -name=f2
\r
48 RUN: FileCheck -input-file=%t.html/index.html %s -check-prefix=HTML-INDEX
\r
49 HTML-INDEX: <h2>Coverage Report</h2>
\r
50 HTML-INDEX: dir-with-filtering1.cpp{{.*}}100.00% (1/1){{.*}}100.00% (4/4){{.*}}100.00% (1/1)
\r
51 HTML-INDEX: dir-with-filtering2.cpp{{.*}}0.00% (0/1){{.*}}0.00% (0/3){{.*}}0.00% (0/1)
\r
53 RUN: FileCheck -input-file=%t.html/coverage/tmp/dir-with-filtering1.cpp.html %s -check-prefix=HTML-FILE1
\r
54 HTML-FILE1-NOT: <pre>f1</pre>
\r
55 HTML-FILE1: <pre>main</pre>
\r
56 HTML-FILE1-NOT: <pre>f1</pre>
\r
57 HTML-FILE1: int main()
\r
58 HTML-FILE1-NOT: <pre>f1</pre>
\r
60 RUN: FileCheck -input-file=%t.html/coverage/tmp/dir-with-filtering2.cpp.html %s -check-prefix=HTML-FILE2
\r
61 HTML-FILE2-NOT: <pre>f3</pre>
\r
62 HTML-FILE2: <pre>_Z2f2v</pre>
\r
63 HTML-FILE2-NOT: <pre>f3</pre>
\r
64 HTML-FILE2: int f2()
\r
65 HTML-FILE2-NOT: <pre>f3</pre>
\r
67 // Test HTML one file
\r
69 RUN: llvm-profdata merge %S/Inputs/dir-with-filtering.proftext -o %t.profdata
\r
70 RUN: llvm-cov show %S/Inputs/dir-with-filtering.covmapping -format html -o %t.html_one_file -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs -name=main -name=f2 %S/Inputs/dir-with-filtering1.cpp
\r
72 RUN: FileCheck -input-file=%t.html_one_file/index.html %s -check-prefix=HTML-INDEX-ONE-FILE
\r
73 HTML-INDEX-ONE-FILE: <h2>Coverage Report</h2>
\r
74 HTML-INDEX-ONE-FILE: dir-with-filtering1.cpp{{.*}}100.00% (1/1){{.*}}100.00% (4/4){{.*}}100.00% (1/1)
\r
75 HTML-INDEX-ONE-FILE-NOT: dir-with-filtering2.cpp
\r
77 RUN: FileCheck -input-file=%t.html_one_file/coverage/tmp/dir-with-filtering1.cpp.html %s -check-prefix=HTML-FILE1
\r
79 // Test HTML index file with all functions in one file filtered out
\r
81 RUN: llvm-cov show %S/Inputs/dir-with-filtering.covmapping -format html -o %t.html_one_func -instr-profile %t.profdata -path-equivalence=/tmp,%S/Inputs -name=main
\r
82 RUN: FileCheck -input-file=%t.html_one_func/index.html %s -check-prefix=HTML-INDEX-ONE-FUNC
\r
84 HTML-INDEX-ONE-FUNC-NOT: Files which contain no functions
\r
85 HTML-INDEX-ONE-FUNC-NOT: dir-with-filtering2.cpp
\r