[LIT] Added an option to llvm-lit to emit the necessary test coverage data, divided...
authorShivam Gupta <Shivam.Gupta2@amd.com>
Fri, 21 Jul 2023 09:26:02 +0000 (14:56 +0530)
committerShivam Gupta <Shivam.Gupta2@amd.com>
Fri, 21 Jul 2023 09:53:01 +0000 (15:23 +0530)
commitd8e26bccb3016d255298b7db78fe8bf05dd880b2
tree836e61d2c8a48be9a351791847c53262ad5c1155
parent8fd207fd0dcc398c2fcfd953d7e3ebe7cb53f188
[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 --emit-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/memtransfer.profraw

Reviewed By: hnrklssn

Differential Revision: https://reviews.llvm.org/D154280
14 files changed:
llvm/CMakeLists.txt
llvm/cmake/modules/HandleLLVMOptions.cmake
llvm/docs/CMake.rst
llvm/docs/CommandGuide/lit.rst
llvm/utils/lit/lit/LitConfig.py
llvm/utils/lit/lit/TestRunner.py
llvm/utils/lit/lit/cl_arguments.py
llvm/utils/lit/lit/main.py
llvm/utils/lit/tests/Inputs/per-test-coverage-by-lit-cfg/lit.cfg [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/per-test-coverage-by-lit-cfg/per-test-coverage-by-lit-cfg.py [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/per-test-coverage/lit.cfg [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/per-test-coverage/per-test-coverage.py [new file with mode: 0644]
llvm/utils/lit/tests/per-test-coverage-by-lit-cfg.py [new file with mode: 0644]
llvm/utils/lit/tests/per-test-coverage.py [new file with mode: 0644]