From d756edfc9a7fcb0e59dbc248756e9446eacaed3b Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 27 Jun 2017 05:05:12 -0400 Subject: [PATCH] CMake: turn testing on, following KDE style. A new option BUILD_TESTING is available; you can turn this off at CMake-time, but building the tests themselves is harmless (although it takes some CPU time). The main advantage of doing this is that running the tests becomes simple: make test Instead of figuring out which tests there are and how to run them individually. Note that the partition-manager tests will normally fail, because they require an additional environment variable to be set to tell them what disk to destroy. --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f48d89fe..f5c894279 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,6 +59,11 @@ option( WITH_PYTHON "Enable Python modules API (requires Boost.Python)." ON ) option( WITH_CRASHREPORTER "Build with CrashReporter" ON ) option( INSTALL_CONFIG "Install configuration files" ON) option( WITH_PYTHONQT "Enable next generation Python modules API (experimental, requires PythonQt)." OFF ) +option(BUILD_TESTING "Build the testing tree." ON) + +if(BUILD_TESTING) + enable_testing() +endif () if( CMAKE_SYSTEM_PROCESSOR MATCHES "arm" OR NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libcrashreporter-qt/CMakeLists.txt" ) message( STATUS "Build of crashreporter disabled." )