From d2e2eef5a58201c4b9b5d5e211afa344da30f7a8 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Wed, 24 Jan 2018 16:06:58 +0100 Subject: [PATCH] Move autotests to autotests top-level directory Also only build tests with BUILD_TESTING enabled. --- CMakeLists.txt | 10 ++++++++-- {tests/autotests => autotests}/CMakeLists.txt | 0 {tests/autotests => autotests}/adblocktest.cpp | 0 {tests/autotests => autotests}/adblocktest.h | 0 {tests/autotests => autotests}/cookiestest.cpp | 0 {tests/autotests => autotests}/cookiestest.h | 0 {tests/autotests => autotests}/formcompletertest.cpp | 0 {tests/autotests => autotests}/formcompletertest.h | 0 {tests/autotests => autotests}/main.cpp | 0 {tests/autotests => autotests}/passwordbackendtest.cpp | 0 {tests/autotests => autotests}/passwordbackendtest.h | 0 {tests/autotests => autotests}/qztoolstest.cpp | 0 {tests/autotests => autotests}/qztoolstest.h | 0 {tests/autotests => autotests}/updatertest.cpp | 0 {tests/autotests => autotests}/updatertest.h | 0 15 files changed, 8 insertions(+), 2 deletions(-) rename {tests/autotests => autotests}/CMakeLists.txt (100%) rename {tests/autotests => autotests}/adblocktest.cpp (100%) rename {tests/autotests => autotests}/adblocktest.h (100%) rename {tests/autotests => autotests}/cookiestest.cpp (100%) rename {tests/autotests => autotests}/cookiestest.h (100%) rename {tests/autotests => autotests}/formcompletertest.cpp (100%) rename {tests/autotests => autotests}/formcompletertest.h (100%) rename {tests/autotests => autotests}/main.cpp (100%) rename {tests/autotests => autotests}/passwordbackendtest.cpp (100%) rename {tests/autotests => autotests}/passwordbackendtest.h (100%) rename {tests/autotests => autotests}/qztoolstest.cpp (100%) rename {tests/autotests => autotests}/qztoolstest.h (100%) rename {tests/autotests => autotests}/updatertest.cpp (100%) rename {tests/autotests => autotests}/updatertest.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index fceb4a105..56eadf738 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,10 @@ add_definitions(-DQT_NO_URL_CAST_FROM_STRING -DQT_USE_QSTRINGBUILDER -DQT_NO_CAS # Mandatory: Qt5 set(QT_MIN_VERSION "5.8.0") -find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Widgets Network Sql QuickWidgets PrintSupport WebEngineWidgets WebChannel Test) +find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Widgets Network Sql QuickWidgets PrintSupport WebEngineWidgets WebChannel) +if (BUILD_TESTING) + find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test) +endif() if (NOT DISABLE_DBUS) find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS DBus) endif() @@ -138,6 +141,9 @@ include_directories( # Finally, go into the subdirs add_subdirectory(src) -add_subdirectory(tests/autotests) + +if (BUILD_TESTING) + add_subdirectory(autotests) +endif() feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/tests/autotests/CMakeLists.txt b/autotests/CMakeLists.txt similarity index 100% rename from tests/autotests/CMakeLists.txt rename to autotests/CMakeLists.txt diff --git a/tests/autotests/adblocktest.cpp b/autotests/adblocktest.cpp similarity index 100% rename from tests/autotests/adblocktest.cpp rename to autotests/adblocktest.cpp diff --git a/tests/autotests/adblocktest.h b/autotests/adblocktest.h similarity index 100% rename from tests/autotests/adblocktest.h rename to autotests/adblocktest.h diff --git a/tests/autotests/cookiestest.cpp b/autotests/cookiestest.cpp similarity index 100% rename from tests/autotests/cookiestest.cpp rename to autotests/cookiestest.cpp diff --git a/tests/autotests/cookiestest.h b/autotests/cookiestest.h similarity index 100% rename from tests/autotests/cookiestest.h rename to autotests/cookiestest.h diff --git a/tests/autotests/formcompletertest.cpp b/autotests/formcompletertest.cpp similarity index 100% rename from tests/autotests/formcompletertest.cpp rename to autotests/formcompletertest.cpp diff --git a/tests/autotests/formcompletertest.h b/autotests/formcompletertest.h similarity index 100% rename from tests/autotests/formcompletertest.h rename to autotests/formcompletertest.h diff --git a/tests/autotests/main.cpp b/autotests/main.cpp similarity index 100% rename from tests/autotests/main.cpp rename to autotests/main.cpp diff --git a/tests/autotests/passwordbackendtest.cpp b/autotests/passwordbackendtest.cpp similarity index 100% rename from tests/autotests/passwordbackendtest.cpp rename to autotests/passwordbackendtest.cpp diff --git a/tests/autotests/passwordbackendtest.h b/autotests/passwordbackendtest.h similarity index 100% rename from tests/autotests/passwordbackendtest.h rename to autotests/passwordbackendtest.h diff --git a/tests/autotests/qztoolstest.cpp b/autotests/qztoolstest.cpp similarity index 100% rename from tests/autotests/qztoolstest.cpp rename to autotests/qztoolstest.cpp diff --git a/tests/autotests/qztoolstest.h b/autotests/qztoolstest.h similarity index 100% rename from tests/autotests/qztoolstest.h rename to autotests/qztoolstest.h diff --git a/tests/autotests/updatertest.cpp b/autotests/updatertest.cpp similarity index 100% rename from tests/autotests/updatertest.cpp rename to autotests/updatertest.cpp diff --git a/tests/autotests/updatertest.h b/autotests/updatertest.h similarity index 100% rename from tests/autotests/updatertest.h rename to autotests/updatertest.h