use test environment set by add_criterion_executable for Criterion_ddsc_config_simple_udp test

Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
This commit is contained in:
Jeroen Koekkoek 2018-08-06 14:02:23 +02:00
parent 657325707c
commit a7bd8f05aa

View file

@ -19,28 +19,17 @@ target_include_directories(criterion_ddsc PRIVATE
"$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src/include/>") "$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src/include/>")
target_link_libraries(criterion_ddsc RoundTrip Space TypesArrayKey ddsc OSAPI) target_link_libraries(criterion_ddsc RoundTrip Space TypesArrayKey ddsc OSAPI)
if(WIN32)
# FIXME: Is this a valid unit test?!
get_target_property(CRITERION_LIBRARY_TYPE Criterion TYPE)
get_target_property(CRITERION_IMPORTED_LOCATION Criterion IMPORTED_LOCATION)
get_filename_component(CRITERION_LIBRARY_DIR "${CRITERION_IMPORTED_LOCATION}" PATH)
endif()
# Setup environment for config-tests # Setup environment for config-tests
set(Criterion_ddsc_config_simple_udp_file "${CMAKE_CURRENT_LIST_DIR}/config_simple_udp.xml") get_test_property(Criterion_ddsc_config_simple_udp ENVIRONMENT ENVIRON)
set(Criterion_ddsc_config_simple_udp_uri "file://${Criterion_ddsc_config_simple_udp_file}") set(CONFIG_FILE "${CMAKE_CURRENT_LIST_DIR}/config_simple_udp.xml")
set(Criterion_ddsc_config_simple_udp_max_participants "0") set(ENVIRON "${CMAKE_PROJECT_NAME_CAPS}_URI=file://${CONFIG_FILE};MAX_PARTICIPANTS=0;${ENVIRON}")
if(WIN32)
message(STATUS "Environment for Criterion_ddsc_config_simple_udp: ${ENVIRON}")
set_tests_properties( set_tests_properties(
Criterion_ddsc_config_simple_udp Criterion_ddsc_config_simple_udp
PROPERTIES PROPERTIES
REQUIRED_FILES ${Criterion_ddsc_config_simple_udp_file} REQUIRED_FILES ${CONFIG_FILE}
ENVIRONMENT "${CMAKE_PROJECT_NAME_CAPS}_URI=${Criterion_ddsc_config_simple_udp_uri};MAX_PARTICIPANTS=${Criterion_ddsc_config_simple_udp_max_participants};PATH=${CRITERION_LIBRARY_DIR};$ENV{PATH}") ENVIRONMENT "${ENVIRON}")
else()
set_tests_properties(
Criterion_ddsc_config_simple_udp
PROPERTIES
REQUIRED_FILES ${Criterion_ddsc_config_simple_udp_file}
ENVIRONMENT "${CMAKE_PROJECT_NAME_CAPS}_URI=${Criterion_ddsc_config_simple_udp_uri};MAX_PARTICIPANTS=${Criterion_ddsc_config_simple_udp_max_participants}")
endif()
configure_file("config_env.h.in" "config_env.h") configure_file("config_env.h.in" "config_env.h")