From 82dbef0c12208a1406c3b665d0d4b257f5d71aa0 Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 28 Nov 2022 15:12:44 +0000 Subject: [PATCH] Make Swift tests conditional on Swift support --- test_suite/unit_tests/Network/CMakeLists.txt | 22 ++++++++++++++++---- test_suite/unit_tests/Network/TestSuite.cxx | 6 ++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/test_suite/unit_tests/Network/CMakeLists.txt b/test_suite/unit_tests/Network/CMakeLists.txt index 67d91ee43..9f8ed2ace 100644 --- a/test_suite/unit_tests/Network/CMakeLists.txt +++ b/test_suite/unit_tests/Network/CMakeLists.txt @@ -1,14 +1,28 @@ + + +if (ENABLE_SWIFT) + set(SWIFT_TESTS_SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/test_swiftService.cxx + ${CMAKE_CURRENT_SOURCE_DIR}/test_swiftAircraftManager.cxx + ) + + set(SWIFT_TESTS_HEADERS + ${CMAKE_CURRENT_SOURCE_DIR}/test_swiftService.hxx + ${CMAKE_CURRENT_SOURCE_DIR}/test_swiftAircraftManager.hxx + ) +endif() + + set(TESTSUITE_SOURCES ${TESTSUITE_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/TestSuite.cxx - ${CMAKE_CURRENT_SOURCE_DIR}/test_swiftService.cxx - ${CMAKE_CURRENT_SOURCE_DIR}/test_swiftAircraftManager.cxx + ${SWIFT_TESTS_SOURCES} PARENT_SCOPE ) set(TESTSUITE_HEADERS ${TESTSUITE_HEADERS} - ${CMAKE_CURRENT_SOURCE_DIR}/test_swiftService.hxx - ${CMAKE_CURRENT_SOURCE_DIR}/test_swiftAircraftManager.hxx + ${SWIFT_TESTS_HEADERS} PARENT_SCOPE ) + diff --git a/test_suite/unit_tests/Network/TestSuite.cxx b/test_suite/unit_tests/Network/TestSuite.cxx index f5cdfbbbf..217dcda57 100644 --- a/test_suite/unit_tests/Network/TestSuite.cxx +++ b/test_suite/unit_tests/Network/TestSuite.cxx @@ -3,9 +3,15 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ +#include "config.h" + +#if defined(ENABLE_SWIFT) + #include "test_swiftAircraftManager.hxx" #include "test_swiftService.hxx" // Set up the unit tests. CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(SwiftAircraftManagerTest, "Unit tests"); CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(SwiftServiceTest, "Unit tests"); + +#endif \ No newline at end of file