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 beb8c3a99d
commit 8ea45bf50c
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A

View File

@ -144,7 +144,7 @@ function(ParseAndAddCatchTests_ParseFile SourceFile TestTarget)
if("${TestType}" STREQUAL "SCENARIO")
set(Name "Scenario: ${Name}")
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}")
else()
set(CTestName "${Name}")