From d6b80bb86da8aab9259c50ec886448b9c9843c85 Mon Sep 17 00:00:00 2001 From: Philipp Storz Date: Fri, 24 Jan 2020 11:25:49 +0100 Subject: [PATCH] system tests: skip catalog test if gtest not available --- core/src/CMakeLists.txt | 8 ++++++-- systemtests/CMakeLists.txt | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/src/CMakeLists.txt b/core/src/CMakeLists.txt index 77e178c4d49..1384a9d6d18 100644 --- a/core/src/CMakeLists.txt +++ b/core/src/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOSĀ® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2017-2019 Bareos GmbH & Co. KG +# Copyright (C) 2017-2020 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -27,7 +27,11 @@ if(NOT client-only) add_subdirectory(stored) endif() -if(GTEST_FOUND) +if(RUN_SYSTEMTESTS_ON_INSTALLED_FILES) + message(status "Skipping unit tests as testing on installed files is requested") +elseif(NOT GTEST_FOUND) + message(status "Skipping unit tests as gtest was not found") +else() add_subdirectory(tests) endif() diff --git a/systemtests/CMakeLists.txt b/systemtests/CMakeLists.txt index 899b487cf48..41c36f6dbe8 100644 --- a/systemtests/CMakeLists.txt +++ b/systemtests/CMakeLists.txt @@ -576,9 +576,9 @@ else() endif() bareosfindlibrary("gtest") -if(GTEST_FOUND) +if(GTEST_FOUND AND NOT RUN_SYSTEMTESTS_ON_INSTALLED_FILES) list(APPEND SYSTEM_TESTS "catalog") - message(STATUS "adding catalog test as gtest was found") + message(STATUS "adding catalog test as gtest was found and not testing installed files") else() list(APPEND SYSTEM_TESTS_DISABLED "catalog") message(STATUS "disabling catalog test as gtest was not found")