Tests: Add case for llvm-cov usage by ctest command line modes

Follow up commit a7780d1b9c (ctest: Add a `CoverageTool` setting to
enable integration with `llvm-cov`, 2026-04-15).

Issue: #26932
This commit is contained in:
Brad King
2026-05-11 11:32:15 -04:00
parent 46410ea189
commit 5494697ed1
3 changed files with 20 additions and 0 deletions
@@ -0,0 +1,2 @@
Using environment variable LLVM_PROFILE_FILE=[^
]*/Tests/RunCMake/CTestCommandLine/CoverageTool/test1_%p\.profraw
@@ -0,0 +1,2 @@
Using environment variable LLVM_PROFILE_FILE=[^
]*/Tests/RunCMake/CTestCommandLine/CoverageTool/test1_%p\.profraw
@@ -769,3 +769,19 @@ run_cmake_command(Passthrough-build-and-test-empty-error ${CMAKE_CTEST_COMMAND}
${RunCMake_BINARY_DIR}/Passthrough-build-and-test-empty-error/does-not-exist
${RunCMake_BINARY_DIR}/Passthrough-build-and-test-empty-error/does-not-exist
--build-generator "None" --)
block()
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CoverageTool)
set(RunCMake_TEST_NO_CLEAN 1)
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
file(WRITE "${RunCMake_TEST_BINARY_DIR}/DartConfiguration.tcl" "
BuildDirectory: ${RunCMake_TEST_BINARY_DIR}
CTestTestCoverageTool: LLVM-COV
")
file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
add_test(test1 \"${CMAKE_COMMAND}\" -E true)
")
run_cmake_command(CoverageTool ${CMAKE_CTEST_COMMAND} -V)
run_cmake_command(CoverageTool-T-Test ${CMAKE_CTEST_COMMAND} -V -T Test)
endblock()