Changeset View
Changeset View
Standalone View
Standalone View
cmake/modules/TestSuite.cmake
# Allow to easily build test suites | # Allow to easily build test suites | ||||
macro(add_test_environment VARIABLE VALUE) | macro(add_test_environment VARIABLE VALUE) | ||||
set_property(GLOBAL APPEND PROPERTY TEST_ENVIRONMENT "${VARIABLE}=${VALUE}") | set_property(GLOBAL APPEND PROPERTY TEST_ENVIRONMENT "${VARIABLE}=${VALUE}") | ||||
endmacro() | endmacro() | ||||
function(add_test_custom_target TARGET) | function(add_test_custom_target TARGET) | ||||
cmake_parse_arguments(ARG "" "" "CUSTOM_TARGET_ARGS;TEST_COMMAND" ${ARGN}) | cmake_parse_arguments(ARG "" "" "CUSTOM_TARGET_ARGS;TEST_COMMAND" ${ARGN}) | ||||
get_property(TEST_ENVIRONMENT GLOBAL PROPERTY TEST_ENVIRONMENT) | get_property(TEST_ENVIRONMENT GLOBAL PROPERTY TEST_ENVIRONMENT) | ||||
add_custom_target(${TARGET} | add_custom_target(${TARGET} | ||||
${ARG_CUSTOM_TARGET_ARGS} | ${ARG_CUSTOM_TARGET_ARGS} | ||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/junit_reports" | |||||
deadalnix: No need for a folder. | |||||
FabienAuthorUnsubmitted Done Inline ActionsThe whole point of this diff is to move toward a single directory for all the junit files so the CI knows where to look and new files as needed with no further configuration. Fabien: The whole point of this diff is to move toward a single directory for all the junit files so… | |||||
COMMAND ${CMAKE_COMMAND} -E env ${TEST_ENVIRONMENT} ${ARG_TEST_COMMAND} | COMMAND ${CMAKE_COMMAND} -E env ${TEST_ENVIRONMENT} ${ARG_TEST_COMMAND} | ||||
) | ) | ||||
endfunction() | endfunction() | ||||
# Define a new target property to hold the list of tests associated with a test | # Define a new target property to hold the list of tests associated with a test | ||||
# suite. This property is named UNIT_TESTS to avoid confusion with the directory | # suite. This property is named UNIT_TESTS to avoid confusion with the directory | ||||
# level property TESTS. | # level property TESTS. | ||||
define_property(TARGET | define_property(TARGET | ||||
▲ Show 20 Lines • Show All 119 Lines • Show Last 20 Lines |
No need for a folder.