[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 01:23:48 PDT 2023


xgupta added a comment.

> Please also add a test of lit itself (see llvm/utils/lit/tests). I think something using --emit-coverage on a test that echoes $LLVM_PROFILE_FILE should be enough.

Hi Henrik,

Currently, I am getting LLVM_PROFILE_FILE = None instead of LVM_PROFILE_FILE = per-test-coverage.profraw so the test case is failing. And I can't use .ll test case as the opt and other tools should not have a dependency to lit test cases.

Can you suggest if this is the right way to have test case?



================
Comment at: llvm/utils/lit/lit/TestRunner.py:1133
+            llvm_profile_file = test_case_name + ".profraw"
+            env = {"LLVM_PROFILE_FILE": llvm_profile_file}
+        else:
----------------
hnrklssn wrote:
> This looks like it might remove other existing env vars. Could you add a test case checking that other variables remain also?
I have updated the code that will not overwrite env.


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