From a9fa999f799f53772db2d16a722a68883ae6e317 Mon Sep 17 00:00:00 2001 From: Johannes Kauffmann Date: Thu, 27 Oct 2022 23:27:13 +0200 Subject: [PATCH] tests: fix configuring with -no-feature-gui Pick-to: 6.2 6.4 Change-Id: I99765d38c9c37f1fe17b15f7736e4c78c7ffac20 Reviewed-by: Alexandru Croitor --- tests/auto/cmake/CMakeLists.txt | 9 ++++----- tests/auto/corelib/kernel/CMakeLists.txt | 2 +- tests/auto/corelib/serialization/CMakeLists.txt | 2 +- tests/auto/tools/CMakeLists.txt | 3 ++- tests/baseline/CMakeLists.txt | 2 +- tests/benchmarks/corelib/kernel/qvariant/CMakeLists.txt | 5 ++--- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index f86f2ac720..99d36c3d56 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -196,13 +196,12 @@ _qt_internal_test_expect_pass(test_json_plugin_includes) if(NOT NO_GUI) _qt_internal_test_expect_build_fail(test_testlib_no_link_gui) + execute_process(COMMAND ${CMAKE_COMMAND} -E copy + "${CMAKE_CURRENT_SOURCE_DIR}/test_testlib_definitions/main.cpp" + "${CMAKE_CURRENT_BINARY_DIR}/failbuild/test_testlib_no_link_gui/test_testlib_no_link_gui/" + ) endif() -execute_process(COMMAND ${CMAKE_COMMAND} -E copy - "${CMAKE_CURRENT_SOURCE_DIR}/test_testlib_definitions/main.cpp" - "${CMAKE_CURRENT_BINARY_DIR}/failbuild/test_testlib_no_link_gui/test_testlib_no_link_gui/" -) - if (NOT NO_WIDGETS) _qt_internal_test_expect_build_fail(test_testlib_no_link_widgets) execute_process(COMMAND ${CMAKE_COMMAND} -E copy diff --git a/tests/auto/corelib/kernel/CMakeLists.txt b/tests/auto/corelib/kernel/CMakeLists.txt index a556b09953..d76c6d4881 100644 --- a/tests/auto/corelib/kernel/CMakeLists.txt +++ b/tests/auto/corelib/kernel/CMakeLists.txt @@ -14,7 +14,6 @@ add_subdirectory(qmetaobjectbuilder) add_subdirectory(qmetamethod) add_subdirectory(qmetaproperty) add_subdirectory(qmetaenum) -add_subdirectory(qpointer) add_subdirectory(qsignalblocker) add_subdirectory(qsignalmapper) add_subdirectory(qtimer) @@ -29,6 +28,7 @@ endif() if(TARGET Qt::Gui) add_subdirectory(qmetatype) add_subdirectory(qmimedata) + add_subdirectory(qpointer) add_subdirectory(qvariant) endif() if(TARGET Qt::Network AND NOT ANDROID AND NOT UIKIT) diff --git a/tests/auto/corelib/serialization/CMakeLists.txt b/tests/auto/corelib/serialization/CMakeLists.txt index d68b92ba91..a8745f1498 100644 --- a/tests/auto/corelib/serialization/CMakeLists.txt +++ b/tests/auto/corelib/serialization/CMakeLists.txt @@ -15,6 +15,6 @@ endif() if(TARGET Qt::Network) add_subdirectory(qtextstream) endif() -if(TARGET Qt::Network AND TARGET Qt::Xml AND NOT INTEGRITY AND NOT QNX) +if(TARGET Qt::Gui AND TARGET Qt::Network AND TARGET Qt::Xml AND NOT INTEGRITY AND NOT QNX) add_subdirectory(qxmlstream) endif() diff --git a/tests/auto/tools/CMakeLists.txt b/tests/auto/tools/CMakeLists.txt index ee7123da1f..9e59771aa0 100644 --- a/tests/auto/tools/CMakeLists.txt +++ b/tests/auto/tools/CMakeLists.txt @@ -20,7 +20,8 @@ if(TARGET Qt::DBus) add_subdirectory(qdbuscpp2xml) add_subdirectory(qdbusxml2cpp) endif() -if(QT_FEATURE_process AND NOT CMAKE_CROSSCOMPILING) +if(TARGET Qt::Gui AND QT_FEATURE_process AND NOT CMAKE_CROSSCOMPILING) + # testapp (windeployqt) and source_basicapp (macdeployqt) require QtGui. if(QT_FEATURE_macdeployqt) add_subdirectory(macdeployqt) endif() diff --git a/tests/baseline/CMakeLists.txt b/tests/baseline/CMakeLists.txt index a5a5084e87..97d0a13e3e 100644 --- a/tests/baseline/CMakeLists.txt +++ b/tests/baseline/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: BSD-3-Clause -if(TARGET Qt::Network) +if(TARGET Qt::Gui AND TARGET Qt::Network) add_subdirectory(painting) endif() if(TARGET Qt::Network AND TARGET Qt::Widgets) diff --git a/tests/benchmarks/corelib/kernel/qvariant/CMakeLists.txt b/tests/benchmarks/corelib/kernel/qvariant/CMakeLists.txt index c547f356b8..07978956b1 100644 --- a/tests/benchmarks/corelib/kernel/qvariant/CMakeLists.txt +++ b/tests/benchmarks/corelib/kernel/qvariant/CMakeLists.txt @@ -9,14 +9,13 @@ qt_internal_add_benchmark(tst_bench_qvariant SOURCES tst_bench_qvariant.cpp LIBRARIES - Qt::Gui Qt::Test ) ## Scopes: ##################################################################### -qt_internal_extend_target(tst_bench_qvariant CONDITION NOT TARGET Qt::Gui +qt_internal_extend_target(tst_bench_qvariant CONDITION TARGET Qt::Gui LIBRARIES - # Remove: gui + Qt::Gui )