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

Henrik G Olsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 10:56:50 PDT 2023


hnrklssn added a comment.

In D154280#4519029 <https://reviews.llvm.org/D154280#4519029>, @xgupta wrote:

> Hi,
>
> writing test case in llvm/utils/lit/tests seems difficult, as when we run them, there is no .script file generated as in case with other llvm or clang test cases. So the patch is not working there and the env variable is not setting.  I am thinking if we can submit in this way without testcase since lit code is very stable so chances of breaking something is less.
>
>   shivam at linux ~/.llvm/llvm-upstream/build (arcpatch-D154280) $ bin/llvm-lit -a -v --per-test-coverage  ../clang/test/SemaCXX/bool.cpp
>   
>   llvm-lit: /home/shivam/.llvm/llvm-upstream/llvm/utils/lit/lit/llvm/config.py:484: note: using clang: /home/shivam/.llvm/llvm-upstream/build/bin/clang
>   -- Testing: 1 tests, 1 workers --
>   PASS: Clang :: SemaCXX/bool.cpp (1 of 1)
>   Script:
>   --
>   export LLVM_PROFILE_FILE=bool0.profraw && : 'RUN: at line 1';   /home/shivam/.llvm/llvm-upstream/build/bin/clang -cc1 -internal-isystem /home/shivam/.llvm/llvm-upstream/build/lib/clang/17/include -nostdsysteminc -std=c++14 -fsyntax-only -verify=expected,precxx17 -Wno-constant-conversion /home/shivam/.llvm/llvm-upstream/clang/test/SemaCXX/bool.cpp
>   export LLVM_PROFILE_FILE=bool1.profraw && : 'RUN: at line 2';   /home/shivam/.llvm/llvm-upstream/build/bin/clang -cc1 -internal-isystem /home/shivam/.llvm/llvm-upstream/build/lib/clang/17/include -nostdsysteminc -std=c++14 -fsyntax-only -verify=expected,precxx17 -Wno-constant-conversion -Wno-deprecated -Wdeprecated-increment-bool /home/shivam/.llvm/llvm-upstream/clang/test/SemaCXX/bool.cpp
>   export LLVM_PROFILE_FILE=bool2.profraw && : 'RUN: at line 3';   /home/shivam/.llvm/llvm-upstream/build/bin/clang -cc1 -internal-isystem /home/shivam/.llvm/llvm-upstream/build/lib/clang/17/include -nostdsysteminc -std=c++2b -fsyntax-only -verify=expected,cxx17 -Wno-constant-conversion -Wno-deprecated -Wdeprecated-increment-bool /home/shivam/.llvm/llvm-upstream/clang/test/SemaCXX/bool.cpp
>   --
>   Exit Code: 0
>   
>   
>   ********************
>   
>   Testing Time: 0.76s
>     Passed: 1
>   shivam at linux ~/.llvm/llvm-upstream/build (arcpatch-D154280) $ find . -type f -name "*.profraw" | grep -i "profraw"
>   
>   ./default.profraw
>   ./tools/clang/test/SemaCXX/bool1.profraw
>   ./tools/clang/test/SemaCXX/bool0.profraw
>   ./tools/clang/test/SemaCXX/bool2.profraw

It sounds like it’s because the test is not using external ShTest. Later it might be worth looking into supporting internal lit shell, but I haven’t checked what that would imply yet.


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