From 2327fd21153f6c137998cc7bfd9a6d2134f318cb Mon Sep 17 00:00:00 2001 From: Dennis Klein Date: Thu, 12 Apr 2018 17:46:18 +0200 Subject: [PATCH] Move test directory one up --- CMakeLists.txt | 16 ++++ fairmq/CMakeLists.txt | 81 ++----------------- {fairmq/test => test}/CMakeLists.txt | 9 --- {fairmq/test => test}/device/TestReceiver.h | 0 {fairmq/test => test}/device/TestSender.h | 0 {fairmq/test => test}/device/TestVersion.h | 0 .../test => test}/device/_device_version.cxx | 0 .../device/_multiple_devices.cxx | 0 {fairmq/test => test}/device/runner.cxx | 0 .../event_manager/_event_manager.cxx | 0 .../test => test}/event_manager/runner.cxx | 0 .../helper/devices/TestPairLeft.cxx | 0 .../helper/devices/TestPairRight.cxx | 0 .../helper/devices/TestPollIn.cxx | 0 .../helper/devices/TestPollOut.cxx | 0 .../test => test}/helper/devices/TestPub.cxx | 0 .../test => test}/helper/devices/TestPull.cxx | 0 .../test => test}/helper/devices/TestPush.cxx | 0 .../test => test}/helper/devices/TestRep.cxx | 0 .../test => test}/helper/devices/TestReq.cxx | 0 .../test => test}/helper/devices/TestSub.cxx | 0 .../helper/devices/TestTransferTimeout.cxx | 0 .../test => test}/helper/plugins/dummy.cxx | 0 .../test => test}/helper/plugins/dummy.h.in | 0 .../test => test}/helper/plugins/dummy2.cxx | 0 .../test => test}/helper/plugins/dummy2.h.in | 0 .../test => test}/helper/runTestDevice.cxx | 0 .../message_resize/_message_resize.cxx | 0 .../test => test}/message_resize/runner.cxx | 0 .../parts/_iterator_interface.cxx | 0 {fairmq/test => test}/parts/runner.cxx | 0 .../test => test}/plugin_services/Fixture.h | 0 .../test => test}/plugin_services/_config.cxx | 0 .../plugin_services/_control.cxx | 0 .../test => test}/plugin_services/runner.cxx | 0 {fairmq/test => test}/plugins/_plugin.cxx | 0 .../test => test}/plugins/_plugin_manager.cxx | 0 .../plugins/_plugin_manager_prelink.cxx | 0 {fairmq/test => test}/plugins/runner.cxx | 0 {fairmq/test => test}/protocols/_pair.cxx | 0 {fairmq/test => test}/protocols/_poller.cxx | 0 {fairmq/test => test}/protocols/_pub_sub.cxx | 0 .../test => test}/protocols/_push_pull.cxx | 0 .../protocols/_push_pull_multipart.cxx | 0 {fairmq/test => test}/protocols/_req_rep.cxx | 0 .../protocols/_transfer_timeout.cxx | 0 .../test => test}/protocols/config.json.in | 0 {fairmq/test => test}/protocols/runner.cxx.in | 0 {fairmq/test => test}/protocols/runner.h | 0 .../state_machine/_state_machine.cxx | 0 .../test => test}/state_machine/runner.cxx | 0 51 files changed, 21 insertions(+), 85 deletions(-) rename {fairmq/test => test}/CMakeLists.txt (95%) rename {fairmq/test => test}/device/TestReceiver.h (100%) rename {fairmq/test => test}/device/TestSender.h (100%) rename {fairmq/test => test}/device/TestVersion.h (100%) rename {fairmq/test => test}/device/_device_version.cxx (100%) rename {fairmq/test => test}/device/_multiple_devices.cxx (100%) rename {fairmq/test => test}/device/runner.cxx (100%) rename {fairmq/test => test}/event_manager/_event_manager.cxx (100%) rename {fairmq/test => test}/event_manager/runner.cxx (100%) rename {fairmq/test => test}/helper/devices/TestPairLeft.cxx (100%) rename {fairmq/test => test}/helper/devices/TestPairRight.cxx (100%) rename {fairmq/test => test}/helper/devices/TestPollIn.cxx (100%) rename {fairmq/test => test}/helper/devices/TestPollOut.cxx (100%) rename {fairmq/test => test}/helper/devices/TestPub.cxx (100%) rename {fairmq/test => test}/helper/devices/TestPull.cxx (100%) rename {fairmq/test => test}/helper/devices/TestPush.cxx (100%) rename {fairmq/test => test}/helper/devices/TestRep.cxx (100%) rename {fairmq/test => test}/helper/devices/TestReq.cxx (100%) rename {fairmq/test => test}/helper/devices/TestSub.cxx (100%) rename {fairmq/test => test}/helper/devices/TestTransferTimeout.cxx (100%) rename {fairmq/test => test}/helper/plugins/dummy.cxx (100%) rename {fairmq/test => test}/helper/plugins/dummy.h.in (100%) rename {fairmq/test => test}/helper/plugins/dummy2.cxx (100%) rename {fairmq/test => test}/helper/plugins/dummy2.h.in (100%) rename {fairmq/test => test}/helper/runTestDevice.cxx (100%) rename {fairmq/test => test}/message_resize/_message_resize.cxx (100%) rename {fairmq/test => test}/message_resize/runner.cxx (100%) rename {fairmq/test => test}/parts/_iterator_interface.cxx (100%) rename {fairmq/test => test}/parts/runner.cxx (100%) rename {fairmq/test => test}/plugin_services/Fixture.h (100%) rename {fairmq/test => test}/plugin_services/_config.cxx (100%) rename {fairmq/test => test}/plugin_services/_control.cxx (100%) rename {fairmq/test => test}/plugin_services/runner.cxx (100%) rename {fairmq/test => test}/plugins/_plugin.cxx (100%) rename {fairmq/test => test}/plugins/_plugin_manager.cxx (100%) rename {fairmq/test => test}/plugins/_plugin_manager_prelink.cxx (100%) rename {fairmq/test => test}/plugins/runner.cxx (100%) rename {fairmq/test => test}/protocols/_pair.cxx (100%) rename {fairmq/test => test}/protocols/_poller.cxx (100%) rename {fairmq/test => test}/protocols/_pub_sub.cxx (100%) rename {fairmq/test => test}/protocols/_push_pull.cxx (100%) rename {fairmq/test => test}/protocols/_push_pull_multipart.cxx (100%) rename {fairmq/test => test}/protocols/_req_rep.cxx (100%) rename {fairmq/test => test}/protocols/_transfer_timeout.cxx (100%) rename {fairmq/test => test}/protocols/config.json.in (100%) rename {fairmq/test => test}/protocols/runner.cxx.in (100%) rename {fairmq/test => test}/protocols/runner.h (100%) rename {fairmq/test => test}/state_machine/_state_machine.cxx (100%) rename {fairmq/test => test}/state_machine/runner.cxx (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6162d13f..526ceca0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,8 @@ project(FairMQ VERSION ${FairMQ_VERSION} LANGUAGES CXX) message("${BWhite}${PROJECT_NAME}${CR} ${FairMQ_GIT_VERSION} from ${FairMQ_DATE}") set_fairmq_defaults() + +include(CTest) ################################################################################ @@ -37,6 +39,10 @@ find_package(Boost 1.64 ${SILENCE_BOOST} REQUIRED COMPONENTS system) if(BUILD_OFI_TRANSPORT) find_package(OFI 1.6.0 REQUIRED COMPONENTS fi_sockets) endif() + +if(BUILD_TESTING) + find_package(GTest REQUIRED) +endif() ################################################################################ @@ -48,6 +54,10 @@ configure_file(${PROJECT_NAME_LOWER}/Version.h.in ) add_subdirectory(fairmq) + +if(BUILD_TESTING) + add_subdirectory(test) +endif() ################################################################################ @@ -60,6 +70,12 @@ install_fairmq_cmake_package() message(" ") message(" ${Cyan}COMPONENT BUILT? INFO${CR}") message(" ${BWhite}library${CR} ${BGreen}YES${CR} (default, always built)") +if(BUILD_OFI_TRANSPORT) + set(tests_summary "${BGreen}YES${CR} (default, disable with ${BMagenta}-DBUILD_TESTING=OFF${CR})") +else() + set(tests_summary "${BRed} NO${CR} (enable with ${BMagenta}-DBUILD_TESTING=ON${CR})") +endif() +message(" ${BWhite}tests${CR} ${tests_summary}") if(BUILD_OFI_TRANSPORT) set(ofi_summary "${BGreen}YES${CR} (disable with ${BMagenta}-DBUILD_OFI_TRANSPORT=OFF${CR})") else() diff --git a/fairmq/CMakeLists.txt b/fairmq/CMakeLists.txt index 0063ad22..6e3ec152 100644 --- a/fairmq/CMakeLists.txt +++ b/fairmq/CMakeLists.txt @@ -5,29 +5,6 @@ # GNU Lesser General Public Licence (LGPL) version 3, # # copied verbatim in the file "LICENSE" # ################################################################################ -# -# This is the top-level cmake file for the FairMQ submodule. -# -# Testing: -# Enable the building of tests by enabling the cmake option BUILD_TESTING. -# -# Linking: -# Depend on FairMQ target, if you want to link against libFairMQ. -# -# Convenience targets defined: -# * FairMQFull - build everything in the submodule except tests -# * FairMQAll - build everything including tests, if enabled -# * FairMQInstall - install everything from the FairMQ submodule -# * FairMQTests - build all tests in the submodule -# -# Installation: -# * Header files are installed hierarchically -# into ${CMAKE_INSTALL_PREFIX}/include/fairmq -# * All targets in FairMQFull are exported to -# ${CMAKE_INSTALL_PREFIX}/include/cmake/FairMQ.cmake -# with namespace prefix "FairRoot::" -# -# #################### # external plugins # @@ -54,9 +31,6 @@ endif() ################## # subdirectories # ################## -if(BUILD_TESTING) - add_subdirectory(test) -endif() add_subdirectory(shmem/prototype) ########################## @@ -253,7 +227,6 @@ endif() ####################### target_include_directories(FairMQ PUBLIC # consumers inherit public include directories - $ $ $ $ @@ -323,11 +296,11 @@ target_link_libraries(shmmonitor FairMQ) add_executable(uuidGen run/runUuidGenerator.cxx) target_link_libraries(uuidGen FairMQ) -#################### -# aggregate target # -#################### -# all targets except tests -set(FAIRMQ_FULL_TARGETS +########### +# install # +########### +install( + TARGETS # FairMQFull, tests are not installed FairMQ bsampler merger @@ -336,33 +309,6 @@ set(FAIRMQ_FULL_TARGETS sink splitter shmmonitor -) -add_custom_target(FairMQFull DEPENDS ${FAIRMQ_FULL_TARGETS}) -# all targets including tests, if enabled -if(BUILD_TESTING) - set(FAIRMQ_TEST_TARGET FairMQTests) -endif() -add_custom_target(FairMQAll - DEPENDS - FairMQFull - ${FAIRMQ_TEST_TARGET} -) - - -########################### -# generate cotire targets # -########################### -#cotire(${FAIRMQ_FULL_TARGETS}) -# disabled by default for now, because it messes up target properties -# still useful for development - - -########### -# install # -########### -install( - TARGETS # FairMQFull, tests are not installed - ${FAIRMQ_FULL_TARGETS} EXPORT FairMQ @@ -384,20 +330,3 @@ foreach(HEADER ${FAIRMQ_HEADER_FILES}) COMPONENT fairmq ) endforeach() - -# export FairMQ targets -install( - EXPORT FairMQ - DESTINATION include/cmake - NAMESPACE FairRoot:: - EXPORT_LINK_INTERFACE_LIBRARIES - COMPONENT fairmq -) - -# use the following target to only install the fairmq component -add_custom_target(FairMQInstall - DEPENDS FairMQFull - COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_COMPONENT=fairmq -P ${CMAKE_BINARY_DIR}/cmake_install.cmake -) - - diff --git a/fairmq/test/CMakeLists.txt b/test/CMakeLists.txt similarity index 95% rename from fairmq/test/CMakeLists.txt rename to test/CMakeLists.txt index 547acb5d..05366645 100644 --- a/fairmq/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -6,7 +6,6 @@ # copied verbatim in the file "LICENSE" # ################################################################################ -find_package(GTest REQUIRED) include(GTestHelper) ############################# @@ -170,11 +169,3 @@ add_testsuite(FairMQ.StateMachine LINKS FairMQ TIMEOUT 10 ) - -############################## -# Aggregate all test targets # -############################## -add_custom_target(FairMQTests - DEPENDS - ${ALL_TEST_TARGETS} -) diff --git a/fairmq/test/device/TestReceiver.h b/test/device/TestReceiver.h similarity index 100% rename from fairmq/test/device/TestReceiver.h rename to test/device/TestReceiver.h diff --git a/fairmq/test/device/TestSender.h b/test/device/TestSender.h similarity index 100% rename from fairmq/test/device/TestSender.h rename to test/device/TestSender.h diff --git a/fairmq/test/device/TestVersion.h b/test/device/TestVersion.h similarity index 100% rename from fairmq/test/device/TestVersion.h rename to test/device/TestVersion.h diff --git a/fairmq/test/device/_device_version.cxx b/test/device/_device_version.cxx similarity index 100% rename from fairmq/test/device/_device_version.cxx rename to test/device/_device_version.cxx diff --git a/fairmq/test/device/_multiple_devices.cxx b/test/device/_multiple_devices.cxx similarity index 100% rename from fairmq/test/device/_multiple_devices.cxx rename to test/device/_multiple_devices.cxx diff --git a/fairmq/test/device/runner.cxx b/test/device/runner.cxx similarity index 100% rename from fairmq/test/device/runner.cxx rename to test/device/runner.cxx diff --git a/fairmq/test/event_manager/_event_manager.cxx b/test/event_manager/_event_manager.cxx similarity index 100% rename from fairmq/test/event_manager/_event_manager.cxx rename to test/event_manager/_event_manager.cxx diff --git a/fairmq/test/event_manager/runner.cxx b/test/event_manager/runner.cxx similarity index 100% rename from fairmq/test/event_manager/runner.cxx rename to test/event_manager/runner.cxx diff --git a/fairmq/test/helper/devices/TestPairLeft.cxx b/test/helper/devices/TestPairLeft.cxx similarity index 100% rename from fairmq/test/helper/devices/TestPairLeft.cxx rename to test/helper/devices/TestPairLeft.cxx diff --git a/fairmq/test/helper/devices/TestPairRight.cxx b/test/helper/devices/TestPairRight.cxx similarity index 100% rename from fairmq/test/helper/devices/TestPairRight.cxx rename to test/helper/devices/TestPairRight.cxx diff --git a/fairmq/test/helper/devices/TestPollIn.cxx b/test/helper/devices/TestPollIn.cxx similarity index 100% rename from fairmq/test/helper/devices/TestPollIn.cxx rename to test/helper/devices/TestPollIn.cxx diff --git a/fairmq/test/helper/devices/TestPollOut.cxx b/test/helper/devices/TestPollOut.cxx similarity index 100% rename from fairmq/test/helper/devices/TestPollOut.cxx rename to test/helper/devices/TestPollOut.cxx diff --git a/fairmq/test/helper/devices/TestPub.cxx b/test/helper/devices/TestPub.cxx similarity index 100% rename from fairmq/test/helper/devices/TestPub.cxx rename to test/helper/devices/TestPub.cxx diff --git a/fairmq/test/helper/devices/TestPull.cxx b/test/helper/devices/TestPull.cxx similarity index 100% rename from fairmq/test/helper/devices/TestPull.cxx rename to test/helper/devices/TestPull.cxx diff --git a/fairmq/test/helper/devices/TestPush.cxx b/test/helper/devices/TestPush.cxx similarity index 100% rename from fairmq/test/helper/devices/TestPush.cxx rename to test/helper/devices/TestPush.cxx diff --git a/fairmq/test/helper/devices/TestRep.cxx b/test/helper/devices/TestRep.cxx similarity index 100% rename from fairmq/test/helper/devices/TestRep.cxx rename to test/helper/devices/TestRep.cxx diff --git a/fairmq/test/helper/devices/TestReq.cxx b/test/helper/devices/TestReq.cxx similarity index 100% rename from fairmq/test/helper/devices/TestReq.cxx rename to test/helper/devices/TestReq.cxx diff --git a/fairmq/test/helper/devices/TestSub.cxx b/test/helper/devices/TestSub.cxx similarity index 100% rename from fairmq/test/helper/devices/TestSub.cxx rename to test/helper/devices/TestSub.cxx diff --git a/fairmq/test/helper/devices/TestTransferTimeout.cxx b/test/helper/devices/TestTransferTimeout.cxx similarity index 100% rename from fairmq/test/helper/devices/TestTransferTimeout.cxx rename to test/helper/devices/TestTransferTimeout.cxx diff --git a/fairmq/test/helper/plugins/dummy.cxx b/test/helper/plugins/dummy.cxx similarity index 100% rename from fairmq/test/helper/plugins/dummy.cxx rename to test/helper/plugins/dummy.cxx diff --git a/fairmq/test/helper/plugins/dummy.h.in b/test/helper/plugins/dummy.h.in similarity index 100% rename from fairmq/test/helper/plugins/dummy.h.in rename to test/helper/plugins/dummy.h.in diff --git a/fairmq/test/helper/plugins/dummy2.cxx b/test/helper/plugins/dummy2.cxx similarity index 100% rename from fairmq/test/helper/plugins/dummy2.cxx rename to test/helper/plugins/dummy2.cxx diff --git a/fairmq/test/helper/plugins/dummy2.h.in b/test/helper/plugins/dummy2.h.in similarity index 100% rename from fairmq/test/helper/plugins/dummy2.h.in rename to test/helper/plugins/dummy2.h.in diff --git a/fairmq/test/helper/runTestDevice.cxx b/test/helper/runTestDevice.cxx similarity index 100% rename from fairmq/test/helper/runTestDevice.cxx rename to test/helper/runTestDevice.cxx diff --git a/fairmq/test/message_resize/_message_resize.cxx b/test/message_resize/_message_resize.cxx similarity index 100% rename from fairmq/test/message_resize/_message_resize.cxx rename to test/message_resize/_message_resize.cxx diff --git a/fairmq/test/message_resize/runner.cxx b/test/message_resize/runner.cxx similarity index 100% rename from fairmq/test/message_resize/runner.cxx rename to test/message_resize/runner.cxx diff --git a/fairmq/test/parts/_iterator_interface.cxx b/test/parts/_iterator_interface.cxx similarity index 100% rename from fairmq/test/parts/_iterator_interface.cxx rename to test/parts/_iterator_interface.cxx diff --git a/fairmq/test/parts/runner.cxx b/test/parts/runner.cxx similarity index 100% rename from fairmq/test/parts/runner.cxx rename to test/parts/runner.cxx diff --git a/fairmq/test/plugin_services/Fixture.h b/test/plugin_services/Fixture.h similarity index 100% rename from fairmq/test/plugin_services/Fixture.h rename to test/plugin_services/Fixture.h diff --git a/fairmq/test/plugin_services/_config.cxx b/test/plugin_services/_config.cxx similarity index 100% rename from fairmq/test/plugin_services/_config.cxx rename to test/plugin_services/_config.cxx diff --git a/fairmq/test/plugin_services/_control.cxx b/test/plugin_services/_control.cxx similarity index 100% rename from fairmq/test/plugin_services/_control.cxx rename to test/plugin_services/_control.cxx diff --git a/fairmq/test/plugin_services/runner.cxx b/test/plugin_services/runner.cxx similarity index 100% rename from fairmq/test/plugin_services/runner.cxx rename to test/plugin_services/runner.cxx diff --git a/fairmq/test/plugins/_plugin.cxx b/test/plugins/_plugin.cxx similarity index 100% rename from fairmq/test/plugins/_plugin.cxx rename to test/plugins/_plugin.cxx diff --git a/fairmq/test/plugins/_plugin_manager.cxx b/test/plugins/_plugin_manager.cxx similarity index 100% rename from fairmq/test/plugins/_plugin_manager.cxx rename to test/plugins/_plugin_manager.cxx diff --git a/fairmq/test/plugins/_plugin_manager_prelink.cxx b/test/plugins/_plugin_manager_prelink.cxx similarity index 100% rename from fairmq/test/plugins/_plugin_manager_prelink.cxx rename to test/plugins/_plugin_manager_prelink.cxx diff --git a/fairmq/test/plugins/runner.cxx b/test/plugins/runner.cxx similarity index 100% rename from fairmq/test/plugins/runner.cxx rename to test/plugins/runner.cxx diff --git a/fairmq/test/protocols/_pair.cxx b/test/protocols/_pair.cxx similarity index 100% rename from fairmq/test/protocols/_pair.cxx rename to test/protocols/_pair.cxx diff --git a/fairmq/test/protocols/_poller.cxx b/test/protocols/_poller.cxx similarity index 100% rename from fairmq/test/protocols/_poller.cxx rename to test/protocols/_poller.cxx diff --git a/fairmq/test/protocols/_pub_sub.cxx b/test/protocols/_pub_sub.cxx similarity index 100% rename from fairmq/test/protocols/_pub_sub.cxx rename to test/protocols/_pub_sub.cxx diff --git a/fairmq/test/protocols/_push_pull.cxx b/test/protocols/_push_pull.cxx similarity index 100% rename from fairmq/test/protocols/_push_pull.cxx rename to test/protocols/_push_pull.cxx diff --git a/fairmq/test/protocols/_push_pull_multipart.cxx b/test/protocols/_push_pull_multipart.cxx similarity index 100% rename from fairmq/test/protocols/_push_pull_multipart.cxx rename to test/protocols/_push_pull_multipart.cxx diff --git a/fairmq/test/protocols/_req_rep.cxx b/test/protocols/_req_rep.cxx similarity index 100% rename from fairmq/test/protocols/_req_rep.cxx rename to test/protocols/_req_rep.cxx diff --git a/fairmq/test/protocols/_transfer_timeout.cxx b/test/protocols/_transfer_timeout.cxx similarity index 100% rename from fairmq/test/protocols/_transfer_timeout.cxx rename to test/protocols/_transfer_timeout.cxx diff --git a/fairmq/test/protocols/config.json.in b/test/protocols/config.json.in similarity index 100% rename from fairmq/test/protocols/config.json.in rename to test/protocols/config.json.in diff --git a/fairmq/test/protocols/runner.cxx.in b/test/protocols/runner.cxx.in similarity index 100% rename from fairmq/test/protocols/runner.cxx.in rename to test/protocols/runner.cxx.in diff --git a/fairmq/test/protocols/runner.h b/test/protocols/runner.h similarity index 100% rename from fairmq/test/protocols/runner.h rename to test/protocols/runner.h diff --git a/fairmq/test/state_machine/_state_machine.cxx b/test/state_machine/_state_machine.cxx similarity index 100% rename from fairmq/test/state_machine/_state_machine.cxx rename to test/state_machine/_state_machine.cxx diff --git a/fairmq/test/state_machine/runner.cxx b/test/state_machine/runner.cxx similarity index 100% rename from fairmq/test/state_machine/runner.cxx rename to test/state_machine/runner.cxx