File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,11 +50,22 @@ if(BUILD_TESTING)
5050 # done in one TEST_CASE expected to carry over into the next TEST_CASE. This
5151 # macro allows us to add common command line arguments to all tests. For now,
5252 # we ensure declaration order execution via --order decl.
53+ # macro(add_catch2_test)
54+ # set(oneValueArgs NAME ENVIRONMENT)
55+ # cmake_parse_arguments(CATCH2_TEST "" ${oneValueArgs} "" ${ARGN})
56+ # catch_discover_tests(${CATCH2_TEST_NAME} PROPERTIES ENVIRONMENT ${CATCH2_TEST_ENVIRONMENT})
57+ # endmacro()
5358 macro (add_catch2_test )
54- set (oneValueArgs NAME ENVIRONMENT)
55- cmake_parse_arguments (CATCH2_TEST "" ${oneValueArgs} "" ${ARGN} )
56- catch_discover_tests (${CATCH2_TEST_NAME} PROPERTIES ENVIRONMENT ${CATCH2_TEST_ENVIRONMENT} )
59+ cmake_parse_arguments (CATCH2_TEST "" "NAME" "ENVIRONMENT" ${ARGN} )
60+
61+ set (_catch_properties)
62+ if (CATCH2_TEST_ENVIRONMENT)
63+ list (APPEND _catch_properties ENVIRONMENT "${CATCH2_TEST_ENVIRONMENT} " )
64+ endif ()
65+
66+ catch_discover_tests (${CATCH2_TEST_NAME} PROPERTIES ${_catch_properties} )
5767 endmacro ()
68+
5869endif ()
5970
6071if (NOT TARGET yaml-cpp::yaml-cpp)
Original file line number Diff line number Diff line change @@ -21,11 +21,8 @@ target_link_libraries(esitest PUBLIC esi-common esicore)
2121macro (ADD_ESI_TEST NAME )
2222 add_executable (${NAME} print_funcs.cc ${ARGN} )
2323 target_link_libraries (${NAME} PRIVATE esitest )
24- add_catch2_test (NAME ${NAME} COMMAND $<TARGET_FILE :${NAME} >)
25- # Use ASan leak suppression for intentional DbgCtl leaks (issue #12776)
26- set_tests_properties (
27- ${NAME} PROPERTIES ENVIRONMENT
28- "LSAN_OPTIONS=suppressions=${CMAKE_CURRENT_SOURCE_DIR} /esi_test_leak_suppression.txt"
24+ add_catch2_test (
25+ NAME ${NAME} ENVIRONMENT "LSAN_OPTIONS=suppressions=${CMAKE_CURRENT_SOURCE_DIR} /esi_test_leak_suppression.txt"
2926 )
3027endmacro ()
3128
You can’t perform that action at this time.
0 commit comments