From 71c19cac99912c07a7350dd96a850d078bee9fb8 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 10 Jan 2017 18:57:38 +0100 Subject: [PATCH] Regroup CMake options for testing -DENABLE_UNIT_TESTING (defaults to ON): Builds unit tests -DENABLE_SYSTEM_TESTING (defaults to OFF): Builds system tests -DENABLE_SYSTEM_TESTING_EXTRA (defaults to OFF): Builds extra tools (a software-defined signal generator and GPSTk) and extra system tests -DENABLE_OWN_GPSTK (defaults to OFF): forces a local download and builds GPSTk even if it is already installed in your system. If ENABLE_SYSTEM_TESTING_EXTRA is set to ON, then ENABLE_SYSTEM_TESTING is also set to ON automatically. This commit removes the option ENABLE_SW_GENERATOR --- CMakeLists.txt | 9 +++++++-- src/tests/CMakeLists.txt | 9 ++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6088edd59..bf4835f84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,8 +67,13 @@ if(ENABLE_PACKAGING) endif(ENABLE_PACKAGING) # Testing -option(ENABLE_SYSTEM_TESTING "Builds system tests" OFF) -option(ENABLE_UNIT_TESTING "Builds unit tests" ON) +option(ENABLE_UNIT_TESTING "Build unit tests" ON) +option(ENABLE_SYSTEM_TESTING "Build system tests" OFF) +option(ENABLE_SYSTEM_TESTING_EXTRA "Download external tools and build extra system tests" OFF) +if(ENABLE_SYSTEM_TESTING_EXTRA) + set(ENABLE_SYSTEM_TESTING ON) +endif(ENABLE_SYSTEM_TESTING_EXTRA) +option(ENABLE_OWN_GPSTK "Force to download, build and link GPSTk for system tests, even if it is already installed" OFF) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 71aae6c90..9d1251909 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -136,8 +136,7 @@ endif(ENABLE_CUDA) ################################################################################ # Optional generator ################################################################################ -option(ENABLE_OWN_GPSTK "Download, build and link GPSTk for system tests" OFF) -if(ENABLE_SW_GENERATOR) +if(ENABLE_SYSTEM_TESTING_EXTRA) ExternalProject_Add( gnss-sim GIT_REPOSITORY https://bitbucket.org/jarribas/gnss-simulator @@ -186,7 +185,7 @@ if(ENABLE_SW_GENERATOR) set(GPSTK_BINDIR ${GPSTK_LIBRARY}/../bin/ ) add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}") endif(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) -endif(ENABLE_SW_GENERATOR) +endif(ENABLE_SYSTEM_TESTING_EXTRA) add_definitions(-DTEST_PATH="${CMAKE_SOURCE_DIR}/src/tests/") @@ -489,7 +488,7 @@ if(ENABLE_SYSTEM_TESTING) ${CMAKE_SOURCE_DIR}/install/$ ) - if(ENABLE_SW_GENERATOR) + if(ENABLE_SYSTEM_TESTING_EXTRA) add_executable(obs_gps_l1_system_test ${CMAKE_CURRENT_SOURCE_DIR}/system-tests/obs_gps_l1_system_test.cc ) if(NOT ${GTEST_DIR_LOCAL}) add_dependencies(obs_gps_l1_system_test gtest-${gtest_RELEASE} ) @@ -507,5 +506,5 @@ if(ENABLE_SYSTEM_TESTING) COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_SOURCE_DIR}/install/$ ) - endif(ENABLE_SW_GENERATOR) + endif(ENABLE_SYSTEM_TESTING_EXTRA) endif(ENABLE_SYSTEM_TESTING)