diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2023-07-11 17:20:10 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2023-07-11 17:38:21 +0200 |
commit | 14381aa10687522041908aa391239de31b799c1f (patch) | |
tree | cfd84222d0f75491edbccbd588f77b64cd9d3b64 | |
parent | 4310152830dda033f05bae58cffd2afd878dda2f (diff) |
CMake: Make qtconnectivity 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: Ib719015455d652172cb4d819a0e457454ef84c8f
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
22 files changed, 132 insertions, 0 deletions
diff --git a/tests/auto/qbluetoothaddress/CMakeLists.txt b/tests/auto/qbluetoothaddress/CMakeLists.txt index 07110c70..0bf39eeb 100644 --- a/tests/auto/qbluetoothaddress/CMakeLists.txt +++ b/tests/auto/qbluetoothaddress/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qbluetoothaddress Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qbluetoothaddress LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qbluetoothaddress SOURCES tst_qbluetoothaddress.cpp diff --git a/tests/auto/qbluetoothdevicediscoveryagent/CMakeLists.txt b/tests/auto/qbluetoothdevicediscoveryagent/CMakeLists.txt index d04e8243..9a43e90d 100644 --- a/tests/auto/qbluetoothdevicediscoveryagent/CMakeLists.txt +++ b/tests/auto/qbluetoothdevicediscoveryagent/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qbluetoothdevicediscoveryagent Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qbluetoothdevicediscoveryagent LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qbluetoothdevicediscoveryagent SOURCES tst_qbluetoothdevicediscoveryagent.cpp diff --git a/tests/auto/qbluetoothdeviceinfo/CMakeLists.txt b/tests/auto/qbluetoothdeviceinfo/CMakeLists.txt index 890d47b0..3b775bfd 100644 --- a/tests/auto/qbluetoothdeviceinfo/CMakeLists.txt +++ b/tests/auto/qbluetoothdeviceinfo/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qbluetoothdeviceinfo Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qbluetoothdeviceinfo LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qbluetoothdeviceinfo SOURCES tst_qbluetoothdeviceinfo.cpp diff --git a/tests/auto/qbluetoothhostinfo/CMakeLists.txt b/tests/auto/qbluetoothhostinfo/CMakeLists.txt index 1483b967..7ab4e9cb 100644 --- a/tests/auto/qbluetoothhostinfo/CMakeLists.txt +++ b/tests/auto/qbluetoothhostinfo/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qbluetoothhostinfo Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qbluetoothhostinfo LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qbluetoothhostinfo SOURCES tst_qbluetoothhostinfo.cpp diff --git a/tests/auto/qbluetoothlocaldevice/CMakeLists.txt b/tests/auto/qbluetoothlocaldevice/CMakeLists.txt index 6d577f81..6b38e25e 100644 --- a/tests/auto/qbluetoothlocaldevice/CMakeLists.txt +++ b/tests/auto/qbluetoothlocaldevice/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qbluetoothlocaldevice Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qbluetoothlocaldevice LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qbluetoothlocaldevice SOURCES tst_qbluetoothlocaldevice.cpp diff --git a/tests/auto/qbluetoothserver/CMakeLists.txt b/tests/auto/qbluetoothserver/CMakeLists.txt index 87fc5b46..f1e29b00 100644 --- a/tests/auto/qbluetoothserver/CMakeLists.txt +++ b/tests/auto/qbluetoothserver/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qbluetoothserver Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qbluetoothserver LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qbluetoothserver SOURCES tst_qbluetoothserver.cpp diff --git a/tests/auto/qbluetoothservicediscoveryagent/CMakeLists.txt b/tests/auto/qbluetoothservicediscoveryagent/CMakeLists.txt index 450180ee..76cd4697 100644 --- a/tests/auto/qbluetoothservicediscoveryagent/CMakeLists.txt +++ b/tests/auto/qbluetoothservicediscoveryagent/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qbluetoothservicediscoveryagent Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qbluetoothservicediscoveryagent LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qbluetoothservicediscoveryagent SOURCES tst_qbluetoothservicediscoveryagent.cpp diff --git a/tests/auto/qbluetoothserviceinfo/CMakeLists.txt b/tests/auto/qbluetoothserviceinfo/CMakeLists.txt index 0e90e936..6974a03a 100644 --- a/tests/auto/qbluetoothserviceinfo/CMakeLists.txt +++ b/tests/auto/qbluetoothserviceinfo/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qbluetoothserviceinfo Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qbluetoothserviceinfo LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qbluetoothserviceinfo SOURCES tst_qbluetoothserviceinfo.cpp diff --git a/tests/auto/qbluetoothsocket/CMakeLists.txt b/tests/auto/qbluetoothsocket/CMakeLists.txt index a9c6eccb..59b6a8f2 100644 --- a/tests/auto/qbluetoothsocket/CMakeLists.txt +++ b/tests/auto/qbluetoothsocket/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qbluetoothsocket Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qbluetoothsocket LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qbluetoothsocket SOURCES tst_qbluetoothsocket.cpp diff --git a/tests/auto/qbluetoothuuid/CMakeLists.txt b/tests/auto/qbluetoothuuid/CMakeLists.txt index f9414100..de981305 100644 --- a/tests/auto/qbluetoothuuid/CMakeLists.txt +++ b/tests/auto/qbluetoothuuid/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qbluetoothuuid Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qbluetoothuuid LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qbluetoothuuid SOURCES tst_qbluetoothuuid.cpp diff --git a/tests/auto/qlowenergycharacteristic/CMakeLists.txt b/tests/auto/qlowenergycharacteristic/CMakeLists.txt index 91a86f47..7089c5cf 100644 --- a/tests/auto/qlowenergycharacteristic/CMakeLists.txt +++ b/tests/auto/qlowenergycharacteristic/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qlowenergycharacteristic Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qlowenergycharacteristic LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qlowenergycharacteristic SOURCES tst_qlowenergycharacteristic.cpp diff --git a/tests/auto/qlowenergycontroller-gattserver/test/CMakeLists.txt b/tests/auto/qlowenergycontroller-gattserver/test/CMakeLists.txt index 4ce1100f..1e01efb2 100644 --- a/tests/auto/qlowenergycontroller-gattserver/test/CMakeLists.txt +++ b/tests/auto/qlowenergycontroller-gattserver/test/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qlowenergycontroller-gattserver Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qlowenergycontroller-gattserver LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qlowenergycontroller-gattserver SOURCES tst_qlowenergycontroller-gattserver.cpp diff --git a/tests/auto/qlowenergycontroller/CMakeLists.txt b/tests/auto/qlowenergycontroller/CMakeLists.txt index f3fba141..f374088e 100644 --- a/tests/auto/qlowenergycontroller/CMakeLists.txt +++ b/tests/auto/qlowenergycontroller/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qlowenergycontroller Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qlowenergycontroller LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qlowenergycontroller SOURCES tst_qlowenergycontroller.cpp diff --git a/tests/auto/qlowenergydescriptor/CMakeLists.txt b/tests/auto/qlowenergydescriptor/CMakeLists.txt index 70188bf9..81b814e1 100644 --- a/tests/auto/qlowenergydescriptor/CMakeLists.txt +++ b/tests/auto/qlowenergydescriptor/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qlowenergydescriptor Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qlowenergydescriptor LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qlowenergydescriptor SOURCES tst_qlowenergydescriptor.cpp diff --git a/tests/auto/qlowenergyservice/CMakeLists.txt b/tests/auto/qlowenergyservice/CMakeLists.txt index 54aa6def..eba5db0e 100644 --- a/tests/auto/qlowenergyservice/CMakeLists.txt +++ b/tests/auto/qlowenergyservice/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qlowenergyservice Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qlowenergyservice LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qlowenergyservice SOURCES tst_qlowenergyservice.cpp diff --git a/tests/auto/qndeffilter/CMakeLists.txt b/tests/auto/qndeffilter/CMakeLists.txt index 3cc217e0..e7fb1e51 100644 --- a/tests/auto/qndeffilter/CMakeLists.txt +++ b/tests/auto/qndeffilter/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_qndeffilter LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qndeffilter SOURCES tst_qndeffilter.cpp diff --git a/tests/auto/qndefmessage/CMakeLists.txt b/tests/auto/qndefmessage/CMakeLists.txt index be378549..6ed6fc2c 100644 --- a/tests/auto/qndefmessage/CMakeLists.txt +++ b/tests/auto/qndefmessage/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qndefmessage Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qndefmessage LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qndefmessage SOURCES tst_qndefmessage.cpp diff --git a/tests/auto/qndefnfcsmartposterrecord/CMakeLists.txt b/tests/auto/qndefnfcsmartposterrecord/CMakeLists.txt index f359d788..6776fa36 100644 --- a/tests/auto/qndefnfcsmartposterrecord/CMakeLists.txt +++ b/tests/auto/qndefnfcsmartposterrecord/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qndefnfcsmartposterrecord Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qndefnfcsmartposterrecord LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qndefnfcsmartposterrecord SOURCES tst_qndefnfcsmartposterrecord.cpp diff --git a/tests/auto/qndefrecord/CMakeLists.txt b/tests/auto/qndefrecord/CMakeLists.txt index b3b9489e..74b5bed2 100644 --- a/tests/auto/qndefrecord/CMakeLists.txt +++ b/tests/auto/qndefrecord/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qndefrecord Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qndefrecord LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qndefrecord SOURCES tst_qndefrecord.cpp diff --git a/tests/auto/qnearfieldmanager/CMakeLists.txt b/tests/auto/qnearfieldmanager/CMakeLists.txt index 805b7870..9fa74032 100644 --- a/tests/auto/qnearfieldmanager/CMakeLists.txt +++ b/tests/auto/qnearfieldmanager/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_qnearfieldmanager LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + if (NOT QT_FEATURE_private_tests) return() endif() diff --git a/tests/auto/qnearfieldtagtype1/CMakeLists.txt b/tests/auto/qnearfieldtagtype1/CMakeLists.txt index b59c0f60..03189bfd 100644 --- a/tests/auto/qnearfieldtagtype1/CMakeLists.txt +++ b/tests/auto/qnearfieldtagtype1/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_qnearfieldtagtype1 LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + if (NOT QT_FEATURE_private_tests) return() endif() diff --git a/tests/auto/qnearfieldtagtype2/CMakeLists.txt b/tests/auto/qnearfieldtagtype2/CMakeLists.txt index 24cd3643..cc6d6f32 100644 --- a/tests/auto/qnearfieldtagtype2/CMakeLists.txt +++ b/tests/auto/qnearfieldtagtype2/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_qnearfieldtagtype2 LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + if (NOT QT_FEATURE_private_tests) return() endif() |