[PATCH] D154280: [LIT] Added an option to llvm-lit to emit the necessary test coverage data, divided per test case

Shivam Gupta via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 4 05:19:39 PDT 2023


xgupta added inline comments.


================
Comment at: llvm/utils/lit/tests/Inputs/per-test-coverage/lit.cfg:7
+config.test_format = lit.formats.ShTest()
+config.substitutions.append(("%LLVM_PROFILE_FILE", os.environ.get('LLVM_PROFILE_FILE')))
----------------
xgupta wrote:
> hnrklssn wrote:
> > Instead of fetching the environment variable here (which seems like it's probably happening before the test is executed?) as part of the test framework, try running a script that reads the env var on its own
> Tried with a script per-test-coverage.py but not working it prints None, same for other env variables. Also same thing happen with .sh script attached in the patch as wip.
But the patch is working as expected I could see - 
```
llvm/llvm-upstream/build $ bin/llvm-lit -a -v --per-test-coverage  ../llvm/test/Analysis/AliasSet

llvm/llvm-upstream/build  $ find .  -type f -name "*.profraw" | grep -i ".profraw$"  
./test/Analysis/AliasSet/unknown-inst-tracking.profraw
./test/Analysis/AliasSet/memtransfer.profraw
./test/Analysis/AliasSet/argmemonly.profraw
./test/Analysis/AliasSet/saturation.profraw
./test/Analysis/AliasSet/guards.profraw
./test/Analysis/AliasSet/memset.profraw
./test/Analysis/AliasSet/intrinsics.profraw
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154280/new/

https://reviews.llvm.org/D154280



More information about the llvm-commits mailing list