From 5818f97e70c90c545a745a066b005f595d44c252 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 29 Jun 2023 17:46:25 +0200 Subject: CMake: Make qml tests standalone projects Add the boilerplate standalone test prelude to each test, so that they can be opened with an IDE without the qt-cmake-standalone-test script, but directly with qt-cmake or cmake. Boilerplate was added using the follow script: https://git.qt.io/alcroito/cmake_refactor Manual adjustments were made where the code was inserted in the wrong location. Task-number: QTBUG-93020 Change-Id: Ia68c9d263e7454f0c4a26c29b10f1c535d08e2f6 Reviewed-by: Joerg Bornemann Reviewed-by: Amir Masoud Abdol --- tests/auto/qml/debugger/qdebugmessageservice/CMakeLists.txt | 6 ++++++ tests/auto/qml/debugger/qpacketprotocol/CMakeLists.txt | 6 ++++++ tests/auto/qml/debugger/qqmldebugclient/CMakeLists.txt | 6 ++++++ .../qqmldebuggingenabler/qqmldebuggingenabler/CMakeLists.txt | 6 ++++++ tests/auto/qml/debugger/qqmldebugjs/CMakeLists.txt | 6 ++++++ tests/auto/qml/debugger/qqmldebuglocal/CMakeLists.txt | 6 ++++++ .../qml/debugger/qqmldebugprocess/qqmldebugprocess/CMakeLists.txt | 6 ++++++ tests/auto/qml/debugger/qqmldebugservice/CMakeLists.txt | 6 ++++++ tests/auto/qml/debugger/qqmldebugtranslationclient/CMakeLists.txt | 6 ++++++ tests/auto/qml/debugger/qqmldebugtranslationservice/CMakeLists.txt | 6 ++++++ tests/auto/qml/debugger/qqmlenginecontrol/CMakeLists.txt | 6 ++++++ .../debugger/qqmlenginedebuginspectorintegrationtest/CMakeLists.txt | 6 ++++++ tests/auto/qml/debugger/qqmlenginedebugservice/CMakeLists.txt | 6 ++++++ tests/auto/qml/debugger/qqmlinspector/CMakeLists.txt | 6 ++++++ tests/auto/qml/debugger/qqmlnativeconnector/CMakeLists.txt | 6 ++++++ tests/auto/qml/debugger/qqmlpreview/CMakeLists.txt | 6 ++++++ tests/auto/qml/debugger/qqmlprofilerservice/CMakeLists.txt | 6 ++++++ tests/auto/qml/debugger/qv4debugger/CMakeLists.txt | 6 ++++++ 18 files changed, 108 insertions(+) (limited to 'tests/auto/qml/debugger') diff --git a/tests/auto/qml/debugger/qdebugmessageservice/CMakeLists.txt b/tests/auto/qml/debugger/qdebugmessageservice/CMakeLists.txt index d3df19bc40..07b6e26544 100644 --- a/tests/auto/qml/debugger/qdebugmessageservice/CMakeLists.txt +++ b/tests/auto/qml/debugger/qdebugmessageservice/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qdebugmessageservice Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qdebugmessageservice LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/tests/auto/qml/debugger/qpacketprotocol/CMakeLists.txt b/tests/auto/qml/debugger/qpacketprotocol/CMakeLists.txt index 146999b9bd..91941de381 100644 --- a/tests/auto/qml/debugger/qpacketprotocol/CMakeLists.txt +++ b/tests/auto/qml/debugger/qpacketprotocol/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qpacketprotocol Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qpacketprotocol LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qpacketprotocol SOURCES ../shared/debugutil.cpp ../shared/debugutil_p.h diff --git a/tests/auto/qml/debugger/qqmldebugclient/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugclient/CMakeLists.txt index 6b33ee0024..d0a63440da 100644 --- a/tests/auto/qml/debugger/qqmldebugclient/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmldebugclient/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmldebugclient Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmldebugclient LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qqmldebugclient SOURCES ../shared/debugutil.cpp ../shared/debugutil_p.h diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/CMakeLists.txt index b73c2aa218..53b1e9c683 100644 --- a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmldebuggingenabler Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmldebuggingenabler LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qqmldebuggingenabler SOURCES ../../shared/debugutil.cpp ../../shared/debugutil_p.h diff --git a/tests/auto/qml/debugger/qqmldebugjs/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugjs/CMakeLists.txt index e48f8e965d..3d65442ebf 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmldebugjs/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmldebugjs Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmldebugjs LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/tests/auto/qml/debugger/qqmldebuglocal/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebuglocal/CMakeLists.txt index 471336139d..03dcb24b3f 100644 --- a/tests/auto/qml/debugger/qqmldebuglocal/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmldebuglocal/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmldebuglocal Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmldebuglocal LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qqmldebuglocal SOURCES ../shared/debugutil.cpp ../shared/debugutil_p.h diff --git a/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocess/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocess/CMakeLists.txt index ea07333ec7..54fe36b7d5 100644 --- a/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocess/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocess/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmldebugprocess Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmldebugprocess LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qqmldebugprocess SOURCES ../../shared/qqmldebugprocess.cpp ../../shared/qqmldebugprocess_p.h diff --git a/tests/auto/qml/debugger/qqmldebugservice/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugservice/CMakeLists.txt index 33b7ba1c2f..2169cb8e0e 100644 --- a/tests/auto/qml/debugger/qqmldebugservice/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmldebugservice/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmldebugservice Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmldebugservice LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/tests/auto/qml/debugger/qqmldebugtranslationclient/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugtranslationclient/CMakeLists.txt index fd44b5d32f..56c2e8d88a 100644 --- a/tests/auto/qml/debugger/qqmldebugtranslationclient/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmldebugtranslationclient/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qqmldebugtranslationclient Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmldebugtranslationclient LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/tests/auto/qml/debugger/qqmldebugtranslationservice/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugtranslationservice/CMakeLists.txt index 7f971df399..5081f51557 100644 --- a/tests/auto/qml/debugger/qqmldebugtranslationservice/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmldebugtranslationservice/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qqmldebugtranslationservice Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmldebugtranslationservice LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/tests/auto/qml/debugger/qqmlenginecontrol/CMakeLists.txt b/tests/auto/qml/debugger/qqmlenginecontrol/CMakeLists.txt index 39435fe894..12c5b4ad1f 100644 --- a/tests/auto/qml/debugger/qqmlenginecontrol/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmlenginecontrol/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmlenginecontrol Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmlenginecontrol LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/CMakeLists.txt b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/CMakeLists.txt index 8b4fc93594..bb36f678c3 100644 --- a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmlenginedebuginspectorintegration Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmlenginedebuginspectorintegration LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/CMakeLists.txt b/tests/auto/qml/debugger/qqmlenginedebugservice/CMakeLists.txt index 4d4a939da5..d412368767 100644 --- a/tests/auto/qml/debugger/qqmlenginedebugservice/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmlenginedebugservice/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmlenginedebugservice Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmlenginedebugservice LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/tests/auto/qml/debugger/qqmlinspector/CMakeLists.txt b/tests/auto/qml/debugger/qqmlinspector/CMakeLists.txt index 7e6fb3559d..34a9b7a393 100644 --- a/tests/auto/qml/debugger/qqmlinspector/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmlinspector/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmlinspector Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmlinspector LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/tests/auto/qml/debugger/qqmlnativeconnector/CMakeLists.txt b/tests/auto/qml/debugger/qqmlnativeconnector/CMakeLists.txt index 705361c3be..f6d8988ec2 100644 --- a/tests/auto/qml/debugger/qqmlnativeconnector/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmlnativeconnector/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmlnativeconnector Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmlnativeconnector LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qqmlnativeconnector SOURCES tst_qqmlnativeconnector.cpp diff --git a/tests/auto/qml/debugger/qqmlpreview/CMakeLists.txt b/tests/auto/qml/debugger/qqmlpreview/CMakeLists.txt index 3eaf14b35d..83d33a617f 100644 --- a/tests/auto/qml/debugger/qqmlpreview/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmlpreview/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmlpreview Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmlpreview LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data list(APPEND test_data "data/window.qml") list(APPEND test_data "data/qtquick2.qml") diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/CMakeLists.txt b/tests/auto/qml/debugger/qqmlprofilerservice/CMakeLists.txt index 1e6c4c1753..d770f1fb27 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmlprofilerservice/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmlprofilerservice Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmlprofilerservice LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/tests/auto/qml/debugger/qv4debugger/CMakeLists.txt b/tests/auto/qml/debugger/qv4debugger/CMakeLists.txt index a60bec4ee7..42f6cf931a 100644 --- a/tests/auto/qml/debugger/qv4debugger/CMakeLists.txt +++ b/tests/auto/qml/debugger/qv4debugger/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qv4debugger Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qv4debugger LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} -- cgit v1.2.3