mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +01:00
Merge hidden-test-disabled and hidden-test-hidden
This commit is contained in:
parent
557e47c3ca
commit
aa1e470058
@ -32,8 +32,6 @@
|
|||||||
# -- enables debug messages #
|
# -- enables debug messages #
|
||||||
# PARSE_CATCH_TESTS_NO_HIDDEN_TESTS (Default OFF) #
|
# PARSE_CATCH_TESTS_NO_HIDDEN_TESTS (Default OFF) #
|
||||||
# -- excludes tests marked with [!hide], [.] or [.foo] tags #
|
# -- excludes tests marked with [!hide], [.] or [.foo] tags #
|
||||||
# PARSE_CATCH_TESTS_HIDDEN_TESTS_DISABLED (Default OFF) #
|
|
||||||
# -- if not excluded, mark tests with [!hide], [.] or [.foo] tags as DISABLED #
|
|
||||||
# PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME (Default ON) #
|
# PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME (Default ON) #
|
||||||
# -- adds fixture class name to the test name #
|
# -- adds fixture class name to the test name #
|
||||||
# PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME (Default ON) #
|
# PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME (Default ON) #
|
||||||
@ -52,7 +50,6 @@ cmake_minimum_required(VERSION 2.8.8)
|
|||||||
|
|
||||||
option(PARSE_CATCH_TESTS_VERBOSE "Print Catch to CTest parser debug messages" OFF)
|
option(PARSE_CATCH_TESTS_VERBOSE "Print Catch to CTest parser debug messages" OFF)
|
||||||
option(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS "Exclude tests with [!hide], [.] or [.foo] tags" OFF)
|
option(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS "Exclude tests with [!hide], [.] or [.foo] tags" OFF)
|
||||||
option(PARSE_CATCH_TESTS_HIDDEN_TESTS_DISABLED "If not excluded, mark tests with [!hide], [.] or [.foo] tags as DISABLED" OFF)
|
|
||||||
option(PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME "Add fixture class name to the test name" ON)
|
option(PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME "Add fixture class name to the test name" ON)
|
||||||
option(PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME "Add target name to the test name" ON)
|
option(PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME "Add target name to the test name" ON)
|
||||||
option(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS "Add test file to CMAKE_CONFIGURE_DEPENDS property" OFF)
|
option(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS "Add test file to CMAKE_CONFIGURE_DEPENDS property" OFF)
|
||||||
@ -167,7 +164,7 @@ function(ParseFile SourceFile TestTarget)
|
|||||||
break()
|
break()
|
||||||
endif(result)
|
endif(result)
|
||||||
endforeach(label)
|
endforeach(label)
|
||||||
if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound})
|
if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_LESS "3.9")
|
||||||
PrintDebugMessage("Skipping test \"${CTestName}\" as it has [!hide], [.] or [.foo] label")
|
PrintDebugMessage("Skipping test \"${CTestName}\" as it has [!hide], [.] or [.foo] label")
|
||||||
else()
|
else()
|
||||||
PrintDebugMessage("Adding test \"${CTestName}\"")
|
PrintDebugMessage("Adding test \"${CTestName}\"")
|
||||||
@ -177,7 +174,8 @@ function(ParseFile SourceFile TestTarget)
|
|||||||
|
|
||||||
# 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} ${TestTarget} ${Name} ${AdditionalCatchParameters})
|
||||||
if(PARSE_CATCH_TESTS_HIDDEN_TESTS_DISABLED AND ${HiddenTagFound})
|
# 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")
|
||||||
PrintDebugMessage("Setting DISABLED test property")
|
PrintDebugMessage("Setting DISABLED test property")
|
||||||
set_tests_properties("\"${CTestName}\"" PROPERTIES DISABLED ON)
|
set_tests_properties("\"${CTestName}\"" PROPERTIES DISABLED ON)
|
||||||
else()
|
else()
|
||||||
@ -186,6 +184,7 @@ function(ParseFile SourceFile TestTarget)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
endforeach()
|
endforeach()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user