From 1189605fbbce14e3471c8544ed58afc0996e2751 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 1 Mar 2018 21:02:48 +0100 Subject: [PATCH] Fix automatic testing in Debian packaging --- src/tests/CMakeLists.txt | 79 ++++++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 35 deletions(-) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 61afb498f..85853b429 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -597,26 +597,6 @@ endif(ENABLE_SYSTEM_TESTING) set(CMAKE_CTEST_COMMAND ctest -V) add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) -add_executable(control_thread_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/control_message_factory_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/control_thread_test.cc ) - -target_link_libraries(control_thread_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - gnss_rx ) - -add_test(control_thread_test control_thread_test) -if(NOT ${GTEST_DIR_LOCAL}) - add_dependencies(control_thread_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) -else(NOT ${GTEST_DIR_LOCAL}) - add_dependencies(control_thread_test gtest) -endif(NOT ${GTEST_DIR_LOCAL}) -set_property(TEST control_thread_test PROPERTY TIMEOUT 30) - -######################################################### - add_executable(flowgraph_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/gnss_flowgraph_test.cc ) @@ -722,19 +702,19 @@ add_executable(acq_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc ) target_link_libraries(acq_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GNURADIO_ANALOG_LIBRARIES} - gnss_sp_libs - gnss_rx - gnss_system_parameters - signal_generator_blocks - signal_processing_testing_lib - ${VOLK_GNSSSDR_LIBRARIES} ) + ${GFlags_LIBS} + ${GLOG_LIBRARIES} + ${GTEST_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} + ${GNURADIO_BLOCKS_LIBRARIES} + ${GNURADIO_FILTER_LIBRARIES} + ${GNURADIO_ANALOG_LIBRARIES} + gnss_sp_libs + gnss_rx + gnss_system_parameters + signal_generator_blocks + signal_processing_testing_lib + ${VOLK_GNSSSDR_LIBRARIES} ) add_test(acq_test acq_test) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(acq_test acq_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) @@ -769,5 +749,34 @@ else(NOT ${GTEST_DIR_LOCAL}) add_dependencies(trk_test gtest) endif(NOT ${GTEST_DIR_LOCAL}) -add_dependencies(check control_thread_test flowgraph_test gnss_block_test - gnuradio_block_test acq_test trk_test matio_test) +######################################################### + +if(NOT ENABLE_PACKAGING) + add_executable(control_thread_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/control_message_factory_test.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/control_thread_test.cc ) + + target_link_libraries(control_thread_test ${Boost_LIBRARIES} + ${GFlags_LIBS} + ${GLOG_LIBRARIES} + ${GTEST_LIBRARIES} + gnss_rx ) + + add_test(control_thread_test control_thread_test) + if(NOT ${GTEST_DIR_LOCAL}) + add_dependencies(control_thread_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) + else(NOT ${GTEST_DIR_LOCAL}) + add_dependencies(control_thread_test gtest) + endif(NOT ${GTEST_DIR_LOCAL}) + set_property(TEST control_thread_test PROPERTY TIMEOUT 30) +endif(NOT ENABLE_PACKAGING) + +######################################################### + +if(ENABLE_PACKAGING) + add_dependencies(check flowgraph_test gnss_block_test + gnuradio_block_test acq_test trk_test matio_test) +else(ENABLE_PACKAGING) + add_dependencies(check control_thread_test flowgraph_test gnss_block_test + gnuradio_block_test acq_test trk_test matio_test) +endif(ENABLE_PACKAGING) \ No newline at end of file