diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2023-06-29 17:28:53 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2023-07-05 15:09:32 +0200 |
commit | 68cb89c8b294c2c0f2b7f90b5288e49e0ad90cc3 (patch) | |
tree | 31c0c6c28b9460d9a6c862227bb6cf448b4f482c /tests/auto/widgets/graphicsview | |
parent | 8450ab8dec83f075ee028f35b3035c9478fa13ce (diff) |
CMake: Make widgets 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 following scripts:
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: I3c0d1a63c474969e5eaee5fdbb1bb0229482fc5b
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests/auto/widgets/graphicsview')
18 files changed, 108 insertions, 0 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/CMakeLists.txt index 09ba28c415..2b530d39f3 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/CMakeLists.txt +++ b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qgraphicsanchorlayout Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qgraphicsanchorlayout LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qgraphicsanchorlayout SOURCES tst_qgraphicsanchorlayout.cpp diff --git a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/CMakeLists.txt index 9c6d82b357..62235c8d1b 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/CMakeLists.txt +++ b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qgraphicsanchorlayout1 Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qgraphicsanchorlayout1 LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qgraphicsanchorlayout1 SOURCES tst_qgraphicsanchorlayout1.cpp diff --git a/tests/auto/widgets/graphicsview/qgraphicseffectsource/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicseffectsource/CMakeLists.txt index 32893c19d6..1e198d7baa 100644 --- a/tests/auto/widgets/graphicsview/qgraphicseffectsource/CMakeLists.txt +++ b/tests/auto/widgets/graphicsview/qgraphicseffectsource/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qgraphicseffectsource Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qgraphicseffectsource LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qgraphicseffectsource SOURCES tst_qgraphicseffectsource.cpp diff --git a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/CMakeLists.txt index 69d5d70d94..c4ffe216f5 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/CMakeLists.txt +++ b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qgraphicsgridlayout Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qgraphicsgridlayout LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qgraphicsgridlayout SOURCES tst_qgraphicsgridlayout.cpp diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicsitem/CMakeLists.txt index 203377e41a..3ee507cd46 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsitem/CMakeLists.txt +++ b/tests/auto/widgets/graphicsview/qgraphicsitem/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qgraphicsitem Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qgraphicsitem LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qgraphicsitem SOURCES tst_qgraphicsitem.cpp diff --git a/tests/auto/widgets/graphicsview/qgraphicsitemanimation/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicsitemanimation/CMakeLists.txt index 1062d6901a..04bfb3f54a 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsitemanimation/CMakeLists.txt +++ b/tests/auto/widgets/graphicsview/qgraphicsitemanimation/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qgraphicsitemanimation Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qgraphicsitemanimation LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qgraphicsitemanimation SOURCES tst_qgraphicsitemanimation.cpp diff --git a/tests/auto/widgets/graphicsview/qgraphicslayout/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicslayout/CMakeLists.txt index 80eb6f528c..4951558423 100644 --- a/tests/auto/widgets/graphicsview/qgraphicslayout/CMakeLists.txt +++ b/tests/auto/widgets/graphicsview/qgraphicslayout/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qgraphicslayout Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qgraphicslayout LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qgraphicslayout SOURCES tst_qgraphicslayout.cpp diff --git a/tests/auto/widgets/graphicsview/qgraphicslayoutitem/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicslayoutitem/CMakeLists.txt index 48fab30472..7bd25cecf2 100644 --- a/tests/auto/widgets/graphicsview/qgraphicslayoutitem/CMakeLists.txt +++ b/tests/auto/widgets/graphicsview/qgraphicslayoutitem/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qgraphicslayoutitem Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qgraphicslayoutitem LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qgraphicslayoutitem SOURCES tst_qgraphicslayoutitem.cpp diff --git a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/CMakeLists.txt index 8d6c737b11..b63bbb6f33 100644 --- a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/CMakeLists.txt +++ b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qgraphicslinearlayout Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qgraphicslinearlayout LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qgraphicslinearlayout SOURCES tst_qgraphicslinearlayout.cpp diff --git a/tests/auto/widgets/graphicsview/qgraphicsobject/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicsobject/CMakeLists.txt index de96a2082f..0c21d9febc 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsobject/CMakeLists.txt +++ b/tests/auto/widgets/graphicsview/qgraphicsobject/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qgraphicsobject Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qgraphicsobject LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qgraphicsobject SOURCES tst_qgraphicsobject.cpp diff --git a/tests/auto/widgets/graphicsview/qgraphicspixmapitem/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicspixmapitem/CMakeLists.txt index 2de8d5cde2..b60958f4f1 100644 --- a/tests/auto/widgets/graphicsview/qgraphicspixmapitem/CMakeLists.txt +++ b/tests/auto/widgets/graphicsview/qgraphicspixmapitem/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qgraphicspixmapitem Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qgraphicspixmapitem LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qgraphicspixmapitem SOURCES tst_qgraphicspixmapitem.cpp diff --git a/tests/auto/widgets/graphicsview/qgraphicspolygonitem/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicspolygonitem/CMakeLists.txt index 42a5cfc3b6..116378decb 100644 --- a/tests/auto/widgets/graphicsview/qgraphicspolygonitem/CMakeLists.txt +++ b/tests/auto/widgets/graphicsview/qgraphicspolygonitem/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qgraphicspolygonitem Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qgraphicspolygonitem LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qgraphicspolygonitem SOURCES tst_qgraphicspolygonitem.cpp diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/CMakeLists.txt index 2727409c4d..f28ff74cfa 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/CMakeLists.txt +++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qgraphicsproxywidget Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qgraphicsproxywidget LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qgraphicsproxywidget SOURCES tst_qgraphicsproxywidget.cpp diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicsscene/CMakeLists.txt index 12cec73b20..c0dd8995b8 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsscene/CMakeLists.txt +++ b/tests/auto/widgets/graphicsview/qgraphicsscene/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qgraphicsscene Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qgraphicsscene LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Resources: set(testdata_resource_files diff --git a/tests/auto/widgets/graphicsview/qgraphicssceneindex/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicssceneindex/CMakeLists.txt index 8deeeb086d..867831d898 100644 --- a/tests/auto/widgets/graphicsview/qgraphicssceneindex/CMakeLists.txt +++ b/tests/auto/widgets/graphicsview/qgraphicssceneindex/CMakeLists.txt @@ -1,6 +1,12 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: BSD-3-Clause +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qgraphicssceneindex LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + if(NOT QT_FEATURE_private_tests) return() endif() diff --git a/tests/auto/widgets/graphicsview/qgraphicstransform/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicstransform/CMakeLists.txt index d9308f7d2a..a11036b30f 100644 --- a/tests/auto/widgets/graphicsview/qgraphicstransform/CMakeLists.txt +++ b/tests/auto/widgets/graphicsview/qgraphicstransform/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qgraphicstransform Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qgraphicstransform LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qgraphicstransform SOURCES tst_qgraphicstransform.cpp diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicsview/CMakeLists.txt index fcd0f1d54c..cf33de0b33 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/CMakeLists.txt +++ b/tests/auto/widgets/graphicsview/qgraphicsview/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qgraphicsview Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qgraphicsview LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qgraphicsview SOURCES tst_qgraphicsview.cpp tst_qgraphicsview.h diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicswidget/CMakeLists.txt index dbe7992dc1..42e30e4f5d 100644 --- a/tests/auto/widgets/graphicsview/qgraphicswidget/CMakeLists.txt +++ b/tests/auto/widgets/graphicsview/qgraphicswidget/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qgraphicswidget Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qgraphicswidget LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qgraphicswidget SOURCES tst_qgraphicswidget.cpp |