diff options
author | Robert Adam <dev@robert-adam.de> | 2020-09-11 16:29:13 +0300 |
---|---|---|
committer | Robert Adam <dev@robert-adam.de> | 2020-09-11 16:29:13 +0300 |
commit | 2f1614efa929c57971fb4ad7d043c53fb6fdea33 (patch) | |
tree | b50bc13e4775e4eec31e16966c1407eadf36a6af /src/tests | |
parent | 8a86ddf04733c323ee4f332548461167c69534a8 (diff) |
BUILD(cmake): Make online tests optional
The TestServerResolver test requires an active internet connection. This
is something that is not really expected when running the tests and will
cause test failure if used without an internet connection.
Therefore this commit makes this test optional. By default this test
will not be built. If you want to enable it (and potential future
tests that require an internet connection), you have to use
-Donline-tests=ON when invoking cmake.
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/CMakeLists.txt | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 685ccb449..ea81de7a8 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -5,6 +5,8 @@ find_pkg(Qt5 COMPONENTS Test REQUIRED) +option(online-tests "Whether or not tests that need a working internet connection should be included" OFF) + set(TESTS "") macro(use_test TEST_NAME) @@ -28,12 +30,18 @@ use_test("TestPacketDataStream") use_test("TestPasswordGenerator") use_test("TestSelfSignedCertificate") use_test("TestServerAddress") -use_test("TestServerResolver") use_test("TestSSLLocks") use_test("TestStdAbs") use_test("TestTimer") use_test("TestUnresolvedServerAddress") +if(online-tests) + message(STATUS "Including online tests - These will fail if you don't have a working internet connection when running them") + use_test("TestServerResolver") +else() + message(STATUS "Omitting online tests - Testing can be performed without an active internet connection") +endif() + # Set output directory foreach(CURRENT_TEST IN LISTS TESTS) |