1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00
llvm-mirror/test/tools/llvm-cov/multithreaded-report.test
Max Moroz 64c109e669 [lit] Implement "-r" option for builtin "diff" command + a test using that.
Summary:
That would allow to recursively compare directories in tests using
"diff -r" on Windows in a similar way as it can be done on Linux or Mac.

Reviewers: zturner, morehouse, vsk

Reviewed By: zturner

Subscribers: kcc, llvm-commits

Differential Revision: https://reviews.llvm.org/D41776

llvm-svn: 322102
2018-01-09 18:23:34 +00:00

95 lines
3.7 KiB
Plaintext

# 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