Catch.cmake: Support CMake multi-config with PRE_TEST discovery mode#2739
Catch.cmake: Support CMake multi-config with PRE_TEST discovery mode#2739horenmar merged 2 commits intocatchorg:develfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## devel #2739 +/- ##
==========================================
+ Coverage 91.32% 91.36% +0.03%
==========================================
Files 192 190 -2
Lines 7850 7855 +5
==========================================
+ Hits 7169 7176 +7
+ Misses 681 679 -2 |
|
How far along is this? |
@horenmar, IMHO it's ready for review. I was hesitating, because of missing experience with the usage of multi-config targets. After re-reading the docs, made it finally work correctly. Could you pls review? |
horenmar
left a comment
There was a problem hiding this comment.
I tested this with MSVC and it seems to work.
630c7f0 to
9b930ec
Compare
| "if(NOT CTEST_CONFIGURATION_TYPE)" "\n" | ||
| " message(\"No configuration for testing specified, use '-C <cfg>'.\")" "\n" | ||
| "else()" "\n" | ||
| " include(\"${ctest_file_base}_include-\${CTEST_CONFIGURATION_TYPE}.cmake\")" "\n" | ||
| "endif()" "\n" |
There was a problem hiding this comment.
This is fine to merge already, but I still have a question: is there a reason to do this like this (outside of consistency with the surrounding code), rather than either making the newlines part of the line-strings, or using multiline strings?
IIRC something like this would work as well and be simpler to read
set(ctest_include_multi_content [[
if(NOT CTEST_CONFIGURATION_TYPE)
message("No configuration for testing specified, use '-C <cfg>'.")
else()
include("C:/ubuntu/temp/discover-tests-tests/msvc-sln-1/tests-b12d07c_include-${CTEST_CONFIGURATION_TYPE}.cmake")
endif()
]])There was a problem hiding this comment.
Right, the issue is that we want to interpret some of the variables, while [[]] does not do any interpretation. nevermind then
Description
Support CMake multi-config generators with PRE_TEST discovery mode.
Cf. #2670 (comment)
GitHub Issues