mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
Enable definitions propagation for tests
This commit is contained in:
parent
7d5e76dece
commit
5303e916fb
|
@ -51,7 +51,7 @@ function(add_testsuite suitename)
|
||||||
cmake_parse_arguments(testsuite
|
cmake_parse_arguments(testsuite
|
||||||
""
|
""
|
||||||
"TIMEOUT;RUN_SERIAL"
|
"TIMEOUT;RUN_SERIAL"
|
||||||
"SOURCES;LINKS;DEPENDS;INCLUDES"
|
"SOURCES;LINKS;DEPENDS;INCLUDES;DEFINITIONS"
|
||||||
${ARGN}
|
${ARGN}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -69,6 +69,9 @@ function(add_testsuite suitename)
|
||||||
if(testsuite_INCLUDES)
|
if(testsuite_INCLUDES)
|
||||||
target_include_directories(${target} PUBLIC ${testsuite_INCLUDES})
|
target_include_directories(${target} PUBLIC ${testsuite_INCLUDES})
|
||||||
endif()
|
endif()
|
||||||
|
if(testsuite_DEFINITIONS)
|
||||||
|
target_compile_definitions("${target}" PUBLIC ${testsuite_DEFINITIONS})
|
||||||
|
endif()
|
||||||
|
|
||||||
add_test(NAME "${suitename}" WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND ${target})
|
add_test(NAME "${suitename}" WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND ${target})
|
||||||
if(testsuite_TIMEOUT)
|
if(testsuite_TIMEOUT)
|
||||||
|
@ -86,7 +89,7 @@ function(add_testhelper helpername)
|
||||||
cmake_parse_arguments(testhelper
|
cmake_parse_arguments(testhelper
|
||||||
""
|
""
|
||||||
""
|
""
|
||||||
"SOURCES;LINKS;DEPENDS;INCLUDES"
|
"SOURCES;LINKS;DEPENDS;INCLUDES;DEFINITIONS"
|
||||||
${ARGN}
|
${ARGN}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -102,6 +105,9 @@ function(add_testhelper helpername)
|
||||||
if(testhelper_INCLUDES)
|
if(testhelper_INCLUDES)
|
||||||
target_include_directories(${target} PUBLIC ${testhelper_INCLUDES})
|
target_include_directories(${target} PUBLIC ${testhelper_INCLUDES})
|
||||||
endif()
|
endif()
|
||||||
|
if(testhelper_DEFINITIONS)
|
||||||
|
target_compile_definitions(${target} PUBLIC ${testhelper_DEFINITIONS})
|
||||||
|
endif()
|
||||||
|
|
||||||
list(APPEND ALL_TEST_TARGETS ${target})
|
list(APPEND ALL_TEST_TARGETS ${target})
|
||||||
set(ALL_TEST_TARGETS ${ALL_TEST_TARGETS} PARENT_SCOPE)
|
set(ALL_TEST_TARGETS ${ALL_TEST_TARGETS} PARENT_SCOPE)
|
||||||
|
@ -111,7 +117,7 @@ function(add_testlib libname)
|
||||||
cmake_parse_arguments(testlib
|
cmake_parse_arguments(testlib
|
||||||
"HIDDEN"
|
"HIDDEN"
|
||||||
"VERSION"
|
"VERSION"
|
||||||
"SOURCES;LINKS;DEPENDS;INCLUDES"
|
"SOURCES;LINKS;DEPENDS;INCLUDES;DEFINITIONS"
|
||||||
${ARGN}
|
${ARGN}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -133,6 +139,9 @@ function(add_testlib libname)
|
||||||
if(testlib_VERSION)
|
if(testlib_VERSION)
|
||||||
set_target_properties(${target} PROPERTIES VERSION ${testlib_VERSION})
|
set_target_properties(${target} PROPERTIES VERSION ${testlib_VERSION})
|
||||||
endif()
|
endif()
|
||||||
|
if(testlib_DEFINITIONS)
|
||||||
|
target_compile_definitions(${target} PUBLIC ${testlib_DEFINITIONS})
|
||||||
|
endif()
|
||||||
|
|
||||||
list(APPEND ALL_TEST_TARGETS ${target})
|
list(APPEND ALL_TEST_TARGETS ${target})
|
||||||
set(ALL_TEST_TARGETS ${ALL_TEST_TARGETS} PARENT_SCOPE)
|
set(ALL_TEST_TARGETS ${ALL_TEST_TARGETS} PARENT_SCOPE)
|
||||||
|
|
|
@ -30,6 +30,9 @@ add_testhelper(runTestDevice
|
||||||
LINKS FairMQ
|
LINKS FairMQ
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(BUILD_NANOMSG_TRANSPORT)
|
||||||
|
set(definitions DEFINITIONS BUILD_NANOMSG_TRANSPORT)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(MQ_CONFIG "${CMAKE_BINARY_DIR}/test/testsuite_FairMQ.IOPatterns_config.json")
|
set(MQ_CONFIG "${CMAKE_BINARY_DIR}/test/testsuite_FairMQ.IOPatterns_config.json")
|
||||||
set(RUN_TEST_DEVICE "${CMAKE_BINARY_DIR}/test/testhelper_runTestDevice")
|
set(RUN_TEST_DEVICE "${CMAKE_BINARY_DIR}/test/testhelper_runTestDevice")
|
||||||
|
@ -55,6 +58,7 @@ add_testsuite(FairMQ.Protocols
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
TIMEOUT 30
|
TIMEOUT 30
|
||||||
RUN_SERIAL ON
|
RUN_SERIAL ON
|
||||||
|
${definitions}
|
||||||
)
|
)
|
||||||
|
|
||||||
add_testsuite(FairMQ.Parts
|
add_testsuite(FairMQ.Parts
|
||||||
|
@ -77,6 +81,7 @@ add_testsuite(FairMQ.MessageResize
|
||||||
INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/message_resize
|
INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/message_resize
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
TIMEOUT 5
|
TIMEOUT 5
|
||||||
|
${definitions}
|
||||||
)
|
)
|
||||||
|
|
||||||
add_testsuite(FairMQ.Device
|
add_testsuite(FairMQ.Device
|
||||||
|
|
Loading…
Reference in New Issue
Block a user