Change PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME conditional.

When no TEST_CASE_METHOD function, there is no fixture to get.
This commit is contained in:
Invincible 2020-03-23 10:24:10 +08:00 committed by Martin Hořeňovský
parent e5c9a58d66
commit 01bdfe3312

View File

@ -144,7 +144,7 @@ function(ParseAndAddCatchTests_ParseFile SourceFile TestTarget)
if("${TestType}" STREQUAL "SCENARIO") if("${TestType}" STREQUAL "SCENARIO")
set(Name "Scenario: ${Name}") set(Name "Scenario: ${Name}")
endif() endif()
if(PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME AND TestFixture) if(PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME AND "${TestType}" MATCHES "(CATCH_)?TEST_CASE_METHOD" AND TestFixture )
set(CTestName "${TestFixture}:${Name}") set(CTestName "${TestFixture}:${Name}")
else() else()
set(CTestName "${Name}") set(CTestName "${Name}")