95 lines · plain
1# Test "report" command with and without multiple threads.2 3RUN: llvm-cov report -num-threads=1 \4RUN: -path-equivalence=/tmp,%S/Inputs \5RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \6RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.1.report7 8RUN: llvm-cov report -num-threads=10 \9RUN: -path-equivalence=/tmp,%S/Inputs \10RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \11RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.2.report12 13RUN: diff %t.1.report %t.2.report14 15# Test "export" command with and without multiple threads.16RUN: llvm-cov export -num-threads=1 \17RUN: -path-equivalence=/tmp,%S/Inputs \18RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \19RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.1.json20 21RUN: llvm-cov export -num-threads=10 \22RUN: -path-equivalence=/tmp,%S/Inputs \23RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \24RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.2.json25 26RUN: diff %t.1.json %t.2.json27 28# Test "show" command with and without multiple threads, single text file.29RUN: llvm-cov show -format=text -num-threads=1 \30RUN: -path-equivalence=/tmp,%S/Inputs \31RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \32RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.1.text33 34RUN: llvm-cov show -format=text -num-threads=10 \35RUN: -path-equivalence=/tmp,%S/Inputs \36RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \37RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.2.text38 39RUN: diff %t.1.text %t.2.text40 41# Test "show" command with and without multiple threads, single HTML file.42RUN: llvm-cov show -format=html -num-threads=1 \43RUN: -path-equivalence=/tmp,%S/Inputs \44RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \45RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.1.html46 47RUN: llvm-cov show -format=html -num-threads=10 \48RUN: -path-equivalence=/tmp,%S/Inputs \49RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \50RUN: %S/Inputs/multithreaded_report/main.covmapping > %t.2.html51 52RUN: diff %t.1.html %t.2.html 53 54# Test "show" command with and without multiple threads, text directory.55RUN: llvm-cov show -format=text -num-threads=1 \56RUN: -path-equivalence=/tmp,%S/Inputs \57RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \58RUN: %S/Inputs/multithreaded_report/main.covmapping -o %t.1.text_dir59 60RUN: llvm-cov show -format=text -num-threads=10 \61RUN: -path-equivalence=/tmp,%S/Inputs \62RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \63RUN: %S/Inputs/multithreaded_report/main.covmapping -o %t.2.text_dir64 65RUN: diff -r %t.1.text_dir %t.2.text_dir66 67# Test "show" command with and without multiple threads, HTML directory.68RUN: llvm-cov show -format=html -num-threads=1 \69RUN: -path-equivalence=/tmp,%S/Inputs \70RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \71RUN: %S/Inputs/multithreaded_report/main.covmapping -o %t.1.html_dir72 73RUN: llvm-cov show -format=html -num-threads=10 \74RUN: -path-equivalence=/tmp,%S/Inputs \75RUN: -instr-profile %S/Inputs/multithreaded_report/main.profdata \76RUN: %S/Inputs/multithreaded_report/main.covmapping -o %t.2.html_dir77 78RUN: diff -r %t.1.html_dir %t.2.html_dir79 80 81Instructions for regenerating the test:82 83# cd %S/Inputs/multithreaded_report84 85cp -r . /tmp/multithreaded_report86 87clang++ -std=c++11 -mllvm -enable-name-compression=false \88 -fprofile-instr-generate -fcoverage-mapping \89 /tmp/multithreaded_report/*.cc -o main90 91LLVM_PROFILE_FILE="main.profraw" ./main92llvm-profdata merge main.profraw -o main.profdata93llvm-cov convert-for-testing ./main -o ./main.covmapping94rm main main.profraw95