From 7e965629b0bbd463c70f561f6c4bddccd2fd9ae4 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 13 Sep 2021 11:05:40 +0200 Subject: AutoTest: Fix cmake wizard If ctest is going to be used we need to enable testing. Do it globally instead of per framework which already led to forgot it. Change-Id: Ifdb0e94708a26e2496d708361d5b8163aa2912ad Reviewed-by: David Schulz --- share/qtcreator/templates/wizards/autotest/files/tst.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/share/qtcreator/templates/wizards/autotest/files/tst.txt b/share/qtcreator/templates/wizards/autotest/files/tst.txt index 516567cc63..7eb0985b74 100644 --- a/share/qtcreator/templates/wizards/autotest/files/tst.txt +++ b/share/qtcreator/templates/wizards/autotest/files/tst.txt @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.5) project(%{TestCaseName} LANGUAGES CXX) +enable_testing() + @if "%{TestFrameWork}" == "QtTest" @if "%{RequireGUI}" == "true" find_package(QT NAMES Qt6 Qt5 COMPONENTS Gui Test REQUIRED) @@ -19,7 +21,6 @@ set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) -enable_testing() add_executable(%{TestCaseName} %{TestCaseFileWithCppSuffix}) add_test(NAME %{TestCaseName} COMMAND %{TestCaseName}) @@ -43,7 +44,6 @@ set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) -enable_testing() # no need to copy around qml test files for shadow builds - just set the respective define add_definitions(-DQUICK_TEST_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}") @@ -105,7 +105,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) -enable_testing() add_executable(%{TestCaseName} %{MainCppName}) add_test(NAME %{TestCaseName} COMMAND %{TestCaseName}) -- cgit v1.2.3