ParseAndAddCatchTests: Fix tests not found

When using an optional launcher the target name is not interpreted as a
target, therefore it is not replaced automatically with its path.
This commit is contained in:
Daniele E. Domenichelli 2019-03-07 15:07:57 +01:00 committed by Martin Hořeňovský
parent 15150c7b46
commit 682617b5b7

View File

@ -179,7 +179,7 @@ function(ParseFile SourceFile TestTarget)
string(REPLACE "," "\\," Name ${Name}) string(REPLACE "," "\\," Name ${Name})
# Add the test and set its properties # Add the test and set its properties
add_test(NAME "\"${CTestName}\"" COMMAND ${OptionalCatchTestLauncher} ${TestTarget} ${Name} ${AdditionalCatchParameters}) add_test(NAME "\"${CTestName}\"" COMMAND ${OptionalCatchTestLauncher} $<TARGET_FILE:${TestTarget}> ${Name} ${AdditionalCatchParameters})
# Old CMake versions do not document VERSION_GREATER_EQUAL, so we use VERSION_GREATER with 3.8 instead # Old CMake versions do not document VERSION_GREATER_EQUAL, so we use VERSION_GREATER with 3.8 instead
if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_GREATER "3.8") if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_GREATER "3.8")
PrintDebugMessage("Setting DISABLED test property") PrintDebugMessage("Setting DISABLED test property")