llvm-project/llvm/utils/lit/tests/per-test-coverage.py
Shivam Gupta 64d19542e7 [LIT] Added an option to llvm-lit to emit the necessary test coverage data, divided per test case
This patch is the first part of https://llvm.org/OpenProjects.html#llvm_patch_coverage.

We have first define a new variable LLVM_TEST_COVERAGE which when set, pass --per-test-coverage option to
llvm-lit which will help in setting a unique value to LLVM_PROFILE_FILE for each RUN. So for example
coverage data for test case llvm/test/Analysis/AliasSet/memtransfer.ll will be emitted as
build/test/Analysis/AliasSet/memtransfer0.profraw

Reviewed By: hnrklssn

Differential Revision: https://reviews.llvm.org/D154280
2023-07-26 16:47:17 +05:30

7 lines
287 B
Python

# Test LLVM_PROFILE_FILE is set when --per-test-coverage is passed to command line.
# RUN: %{lit} -a -v --per-test-coverage %{inputs}/per-test-coverage/per-test-coverage.py \
# RUN: | FileCheck -match-full-lines %s
#
# CHECK: PASS: per-test-coverage :: per-test-coverage.py ({{[^)]*}})