diff options
Diffstat (limited to 'tests')
1480 files changed, 17615 insertions, 11845 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 89b196e593..0fd486f00c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from tests.pro. if(QT_BUILD_STANDALONE_TESTS) diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt index 16ea50bf63..f69b91d648 100644 --- a/tests/auto/CMakeLists.txt +++ b/tests/auto/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # special case begin # Order by dependency [*], then alphabetic. [*] If bugs in part A of # our source would break tests of part B, then test A before B. @@ -22,6 +25,14 @@ if(UIKIT) return() endif() +# Limit set of tests to run for Android multi-ABI Qt builds. +if(QT_BUILD_MINIMAL_ANDROID_MULTI_ABI_TESTS) + add_subdirectory(corelib/kernel/qmath) + add_subdirectory(widgets/effects/qpixmapfilter) + add_subdirectory(corelib/platform) + return() +endif() + # Only configure a single auto test for wasm for now # Since the linking step at this point is prohibitively long (static linking) if(WASM) diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index 54ce69f0be..48cd4a4719 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # special case skip regeneration # This is an automatic test for the CMake configuration files. @@ -253,11 +256,16 @@ elseif(QT6_INSTALL_BINS) endif() # Test building and installing a few dummy Qt modules and plugins. -_qt_internal_test_expect_pass(mockplugins - BINARY "${CMAKE_COMMAND}" - BINARY_ARGS - "-DQT_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}/mockplugins" - -P "${qt_install_prefix}/${qt_install_bin_dir}/qt-cmake-private-install.cmake") +set(mockplugins_test_args "") +if(NOT QT_FEATURE_no_prefix) + list(APPEND mockplugins_test_args + BINARY "${CMAKE_COMMAND}" + BINARY_ARGS + "-DQT_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}/mockplugins" + -P "${qt_install_prefix}/${qt_install_bin_dir}/qt-cmake-private-install.cmake" + ) +endif() +_qt_internal_test_expect_pass(mockplugins ${mockplugins_test_args}) set_tests_properties(mockplugins PROPERTIES FIXTURES_SETUP build_mockplugins) # Test importing the plugins built in the project above. @@ -272,6 +280,10 @@ endif() _qt_internal_test_expect_pass(test_add_resources_binary_generated BINARY test_add_resources_binary_generated) +if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.17") + _qt_internal_test_expect_pass(test_add_resources_big_resources + BINARY test_add_resources_big_resources) +endif() include(test_plugin_shared_static_flavor.cmake) _qt_internal_test_expect_pass(tst_qaddpreroutine diff --git a/tests/auto/cmake/mockplugins/.cmake.conf b/tests/auto/cmake/mockplugins/.cmake.conf index f7a41402e0..377be0059e 100644 --- a/tests/auto/cmake/mockplugins/.cmake.conf +++ b/tests/auto/cmake/mockplugins/.cmake.conf @@ -1 +1 @@ -set(QT_REPO_MODULE_VERSION "6.4.0") +set(QT_REPO_MODULE_VERSION "6.5.0") diff --git a/tests/auto/cmake/mockplugins/CMakeLists.txt b/tests/auto/cmake/mockplugins/CMakeLists.txt index 7f61b562bc..79ccfcd3a6 100644 --- a/tests/auto/cmake/mockplugins/CMakeLists.txt +++ b/tests/auto/cmake/mockplugins/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qtsvg.pro. cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/mockplugins/mock1plugin/CMakeLists.txt b/tests/auto/cmake/mockplugins/mock1plugin/CMakeLists.txt index 2af59e34eb..a6570015c0 100644 --- a/tests/auto/cmake/mockplugins/mock1plugin/CMakeLists.txt +++ b/tests/auto/cmake/mockplugins/mock1plugin/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + qt_internal_add_plugin(QMock1Plugin CLASS_NAME QMock1Plugin PLUGIN_TYPE mockplugin diff --git a/tests/auto/cmake/mockplugins/mock2plugin/CMakeLists.txt b/tests/auto/cmake/mockplugins/mock2plugin/CMakeLists.txt index 275a57a1ac..706f5f3e0e 100644 --- a/tests/auto/cmake/mockplugins/mock2plugin/CMakeLists.txt +++ b/tests/auto/cmake/mockplugins/mock2plugin/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + qt_internal_add_plugin(QMock2Plugin CLASS_NAME QMock2Plugin PLUGIN_TYPE mockplugin diff --git a/tests/auto/cmake/mockplugins/mock3plugin/CMakeLists.txt b/tests/auto/cmake/mockplugins/mock3plugin/CMakeLists.txt index b87acd1d0e..7936a91f9f 100644 --- a/tests/auto/cmake/mockplugins/mock3plugin/CMakeLists.txt +++ b/tests/auto/cmake/mockplugins/mock3plugin/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + qt_internal_add_plugin(QMock3Plugin CLASS_NAME QMock3Plugin PLUGIN_TYPE mockplugin diff --git a/tests/auto/cmake/mockplugins/mock4plugin/CMakeLists.txt b/tests/auto/cmake/mockplugins/mock4plugin/CMakeLists.txt index f13ec00332..048c07e207 100644 --- a/tests/auto/cmake/mockplugins/mock4plugin/CMakeLists.txt +++ b/tests/auto/cmake/mockplugins/mock4plugin/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + qt_internal_add_plugin(QMock4Plugin CLASS_NAME QMock4Plugin PLUGIN_TYPE mockplugin diff --git a/tests/auto/cmake/mockplugins/mock5plugin/CMakeLists.txt b/tests/auto/cmake/mockplugins/mock5plugin/CMakeLists.txt index d3fa0e428a..4cc3ff9bc4 100644 --- a/tests/auto/cmake/mockplugins/mock5plugin/CMakeLists.txt +++ b/tests/auto/cmake/mockplugins/mock5plugin/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + qt_internal_add_plugin(QMock5Plugin CLASS_NAME QMock5Plugin PLUGIN_TYPE mockplugin diff --git a/tests/auto/cmake/mockplugins/mock6plugin/CMakeLists.txt b/tests/auto/cmake/mockplugins/mock6plugin/CMakeLists.txt index 0311214dde..d6126990ec 100644 --- a/tests/auto/cmake/mockplugins/mock6plugin/CMakeLists.txt +++ b/tests/auto/cmake/mockplugins/mock6plugin/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + qt_internal_add_plugin(QMock6Plugin CLASS_NAME QMock6Plugin PLUGIN_TYPE mockauxplugin diff --git a/tests/auto/cmake/mockplugins/mockplugins1/CMakeLists.txt b/tests/auto/cmake/mockplugins/mockplugins1/CMakeLists.txt index 705885c7fa..b2daaea289 100644 --- a/tests/auto/cmake/mockplugins/mockplugins1/CMakeLists.txt +++ b/tests/auto/cmake/mockplugins/mockplugins1/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + qt_internal_add_module(MockPlugins1 PLUGIN_TYPES mockplugin SOURCES diff --git a/tests/auto/cmake/mockplugins/mockplugins2/CMakeLists.txt b/tests/auto/cmake/mockplugins/mockplugins2/CMakeLists.txt index 9d406ef483..aa82cf6a40 100644 --- a/tests/auto/cmake/mockplugins/mockplugins2/CMakeLists.txt +++ b/tests/auto/cmake/mockplugins/mockplugins2/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + qt_internal_add_module(MockPlugins2 SOURCES fake.cpp diff --git a/tests/auto/cmake/mockplugins/mockplugins3/CMakeLists.txt b/tests/auto/cmake/mockplugins/mockplugins3/CMakeLists.txt index fc7c7aa944..948f54dbd8 100644 --- a/tests/auto/cmake/mockplugins/mockplugins3/CMakeLists.txt +++ b/tests/auto/cmake/mockplugins/mockplugins3/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + qt_internal_add_module(MockPlugins3 PLUGIN_TYPES mockauxplugin SOURCES diff --git a/tests/auto/cmake/test(needsquoting)dirname/CMakeLists.txt b/tests/auto/cmake/test(needsquoting)dirname/CMakeLists.txt index c2a575af65..0efc0252e7 100644 --- a/tests/auto/cmake/test(needsquoting)dirname/CMakeLists.txt +++ b/tests/auto/cmake/test(needsquoting)dirname/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_QFINDTESTDATA/CMakeLists.txt b/tests/auto/cmake/test_QFINDTESTDATA/CMakeLists.txt index b67ff560e4..bfd694a9ab 100644 --- a/tests/auto/cmake/test_QFINDTESTDATA/CMakeLists.txt +++ b/tests/auto/cmake/test_QFINDTESTDATA/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_QFINDTESTDATA/tests/CMakeLists.txt b/tests/auto/cmake/test_QFINDTESTDATA/tests/CMakeLists.txt index df91a7d84b..4c35fb23ca 100644 --- a/tests/auto/cmake/test_QFINDTESTDATA/tests/CMakeLists.txt +++ b/tests/auto/cmake/test_QFINDTESTDATA/tests/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + add_executable(test_QFINDTESTDATA WIN32 main.cpp) diff --git a/tests/auto/cmake/test_QTBUG-63422/CMakeLists.txt b/tests/auto/cmake/test_QTBUG-63422/CMakeLists.txt index a256cfc067..31ee1ded50 100644 --- a/tests/auto/cmake/test_QTBUG-63422/CMakeLists.txt +++ b/tests/auto/cmake/test_QTBUG-63422/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) if(POLICY CMP0099) cmake_policy(SET CMP0099 NEW) # Avoid CMP0099 related warnings. diff --git a/tests/auto/cmake/test_QT_TESTCASE_BUILDDIR/CMakeLists.txt b/tests/auto/cmake/test_QT_TESTCASE_BUILDDIR/CMakeLists.txt index 92ce28a5b9..62dbed6198 100644 --- a/tests/auto/cmake/test_QT_TESTCASE_BUILDDIR/CMakeLists.txt +++ b/tests/auto/cmake/test_QT_TESTCASE_BUILDDIR/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # The test is simply testing that manual specification of QT_TESTCASE_BUILDDIR works, # despite the weird paths. cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_add_big_resource/CMakeLists.txt b/tests/auto/cmake/test_add_big_resource/CMakeLists.txt index b712f5a23d..c8065f1c7e 100644 --- a/tests/auto/cmake/test_add_big_resource/CMakeLists.txt +++ b/tests/auto/cmake/test_add_big_resource/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) project(test_add_big_resource) diff --git a/tests/auto/cmake/test_add_binary_resources_delayed_file/CMakeLists.txt b/tests/auto/cmake/test_add_binary_resources_delayed_file/CMakeLists.txt index 1ca2c0940a..d50ac18e1a 100644 --- a/tests/auto/cmake/test_add_binary_resources_delayed_file/CMakeLists.txt +++ b/tests/auto/cmake/test_add_binary_resources_delayed_file/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_add_binary_resources_delayed_file/main.cpp b/tests/auto/cmake/test_add_binary_resources_delayed_file/main.cpp index 46f4f1028d..b8b6ec7717 100644 --- a/tests/auto/cmake/test_add_binary_resources_delayed_file/main.cpp +++ b/tests/auto/cmake/test_add_binary_resources_delayed_file/main.cpp @@ -9,6 +9,7 @@ int main(int argc, char **argv) if (QResource::registerResource("rcc_file.rcc") && QFile::exists("://resource_file.txt") && QFile::exists("://resource_file_two.txt")) { + QResource::unregisterResource("rcc_file.rcc"); // avoid leaks return 0; } diff --git a/tests/auto/cmake/test_add_resource_options/CMakeLists.txt b/tests/auto/cmake/test_add_resource_options/CMakeLists.txt index 4692cdbdc6..ec6f95963b 100644 --- a/tests/auto/cmake/test_add_resource_options/CMakeLists.txt +++ b/tests/auto/cmake/test_add_resource_options/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_add_resources_big_resources/CMakeLists.txt b/tests/auto/cmake/test_add_resources_big_resources/CMakeLists.txt new file mode 100644 index 0000000000..159bc71c8c --- /dev/null +++ b/tests/auto/cmake/test_add_resources_big_resources/CMakeLists.txt @@ -0,0 +1,45 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +cmake_minimum_required(VERSION 3.16) + +project(test_add_resources_big_resources) + +if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/FindPackageHints.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/FindPackageHints.cmake") +endif() + +find_package(Qt6 REQUIRED + COMPONENTS Core Test + HINTS ${Qt6Tests_PREFIX_PATH} +) + +qt6_add_library(leaf_lib STATIC leaf_lib.cpp) +qt6_add_resources(leaf_lib resources2 + FILES resource2.txt PREFIX "/" BIG_RESOURCES) +target_link_libraries(leaf_lib PRIVATE Qt6::Core) + +if(NOT TARGET leaf_lib_resources2_obj) + message(FATAL_ERROR "Object library for resources2 was not created.") +endif() + +qt6_add_library(intermediate_lib STATIC intermediate_lib.cpp) +qt6_add_resources(intermediate_lib resources3 + FILES resource3.txt PREFIX "/" BIG_RESOURCES +) +target_link_libraries(intermediate_lib PRIVATE Qt6::Core leaf_lib) + +if(NOT TARGET intermediate_lib_resources3_obj) + message(FATAL_ERROR "Object library for resources3 was not created.") +endif() + +set(CMAKE_AUTOMOC ON) + +qt6_add_executable(test_add_resources_big_resources main.cpp) +qt6_add_resources(test_add_resources_big_resources resources1 + FILES resource1.txt PREFIX "/" BIG_RESOURCES) +target_link_libraries(test_add_resources_big_resources PRIVATE Qt6::Test intermediate_lib) + +if(NOT TARGET test_add_resources_big_resources_resources1_obj) + message(FATAL_ERROR "Object library for resources1 was not created.") +endif() diff --git a/tests/auto/cmake/test_add_resources_big_resources/intermediate_lib.cpp b/tests/auto/cmake/test_add_resources_big_resources/intermediate_lib.cpp new file mode 100644 index 0000000000..00817d496d --- /dev/null +++ b/tests/auto/cmake/test_add_resources_big_resources/intermediate_lib.cpp @@ -0,0 +1,20 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "leaf_lib.h" + +#include <QtCore/qfile.h> + +namespace intermediate_lib { + +bool isLeafLibResourceAvailable() +{ + return leaf_lib::isResourceAvailable(); +} + +bool isResourceAvailable() +{ + return QFile::exists(u":/resource3.txt"_qs); +} + +} // namespace diff --git a/tests/auto/cmake/test_add_resources_big_resources/intermediate_lib.h b/tests/auto/cmake/test_add_resources_big_resources/intermediate_lib.h new file mode 100644 index 0000000000..614ebd1abc --- /dev/null +++ b/tests/auto/cmake/test_add_resources_big_resources/intermediate_lib.h @@ -0,0 +1,9 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +namespace intermediate_lib { +bool isLeafLibResourceAvailable(); +bool isResourceAvailable(); +} //namespace diff --git a/tests/auto/cmake/test_add_resources_big_resources/leaf_lib.cpp b/tests/auto/cmake/test_add_resources_big_resources/leaf_lib.cpp new file mode 100644 index 0000000000..0dc07784e9 --- /dev/null +++ b/tests/auto/cmake/test_add_resources_big_resources/leaf_lib.cpp @@ -0,0 +1,13 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include <QtCore/qfile.h> + +namespace leaf_lib { + +bool isResourceAvailable() +{ + return QFile::exists(u":/resource2.txt"_qs); +} + +} // namespace diff --git a/tests/auto/cmake/test_add_resources_big_resources/leaf_lib.h b/tests/auto/cmake/test_add_resources_big_resources/leaf_lib.h new file mode 100644 index 0000000000..9a6c631c1d --- /dev/null +++ b/tests/auto/cmake/test_add_resources_big_resources/leaf_lib.h @@ -0,0 +1,8 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +namespace leaf_lib { +bool isResourceAvailable(); +} // namespace diff --git a/tests/auto/cmake/test_add_resources_big_resources/main.cpp b/tests/auto/cmake/test_add_resources_big_resources/main.cpp new file mode 100644 index 0000000000..5df2b0e5a7 --- /dev/null +++ b/tests/auto/cmake/test_add_resources_big_resources/main.cpp @@ -0,0 +1,35 @@ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "intermediate_lib.h" + +#include <QtCore/qfile.h> +#include <QtTest/QtTest> + +class TestAddResourcesBigResources : public QObject +{ + Q_OBJECT +private slots: + void resourceInApplicationExists(); + void resourceInIntermediateLibExists(); + void resourceInLeafLibExists(); +}; + +void TestAddResourcesBigResources::resourceInApplicationExists() +{ + QVERIFY(QFile::exists(":/resource1.txt")); +} + +void TestAddResourcesBigResources::resourceInIntermediateLibExists() +{ + QVERIFY(intermediate_lib::isResourceAvailable()); +} + +void TestAddResourcesBigResources::resourceInLeafLibExists() +{ + QVERIFY(intermediate_lib::isLeafLibResourceAvailable()); +} + +QTEST_MAIN(TestAddResourcesBigResources) +#include "main.moc" + diff --git a/tests/auto/cmake/test_add_resources_big_resources/resource1.txt b/tests/auto/cmake/test_add_resources_big_resources/resource1.txt new file mode 100644 index 0000000000..bc06a6d721 --- /dev/null +++ b/tests/auto/cmake/test_add_resources_big_resources/resource1.txt @@ -0,0 +1 @@ +Test resource1 diff --git a/tests/auto/cmake/test_add_resources_big_resources/resource2.txt b/tests/auto/cmake/test_add_resources_big_resources/resource2.txt new file mode 100644 index 0000000000..b8f9e67458 --- /dev/null +++ b/tests/auto/cmake/test_add_resources_big_resources/resource2.txt @@ -0,0 +1 @@ +Test resource2 diff --git a/tests/auto/cmake/test_add_resources_big_resources/resource3.txt b/tests/auto/cmake/test_add_resources_big_resources/resource3.txt new file mode 100644 index 0000000000..0ed6318a85 --- /dev/null +++ b/tests/auto/cmake/test_add_resources_big_resources/resource3.txt @@ -0,0 +1 @@ +Test resource3 diff --git a/tests/auto/cmake/test_add_resources_binary_generated/CMakeLists.txt b/tests/auto/cmake/test_add_resources_binary_generated/CMakeLists.txt index 2d5a399a0c..f20be4ffdf 100644 --- a/tests/auto/cmake/test_add_resources_binary_generated/CMakeLists.txt +++ b/tests/auto/cmake/test_add_resources_binary_generated/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) project(test_add_resources_binary_generated) diff --git a/tests/auto/cmake/test_add_resources_binary_generated/main.cpp b/tests/auto/cmake/test_add_resources_binary_generated/main.cpp index 65d5ff306b..906232ca19 100644 --- a/tests/auto/cmake/test_add_resources_binary_generated/main.cpp +++ b/tests/auto/cmake/test_add_resources_binary_generated/main.cpp @@ -12,5 +12,9 @@ int main(int, char **) || !QFile::exists(":/resource2.txt")) { return -1; } + + // Avoid leaks + QResource::unregisterResource(RESOURCE1_FULL_PATH); + QResource::unregisterResource(RESOURCE2_FULL_PATH); return 0; } diff --git a/tests/auto/cmake/test_add_resources_delayed_file/CMakeLists.txt b/tests/auto/cmake/test_add_resources_delayed_file/CMakeLists.txt index 49bc5cbb2b..97c97779c4 100644 --- a/tests/auto/cmake/test_add_resources_delayed_file/CMakeLists.txt +++ b/tests/auto/cmake/test_add_resources_delayed_file/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_build_simple_widget_app/CMakeLists.txt b/tests/auto/cmake/test_build_simple_widget_app/CMakeLists.txt index daccf5bb80..0c652caf21 100644 --- a/tests/auto/cmake/test_build_simple_widget_app/CMakeLists.txt +++ b/tests/auto/cmake/test_build_simple_widget_app/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) project(ios_projects LANGUAGES CXX) diff --git a/tests/auto/cmake/test_concurrent_module/CMakeLists.txt b/tests/auto/cmake/test_concurrent_module/CMakeLists.txt index 3294535319..901a48ff5c 100644 --- a/tests/auto/cmake/test_concurrent_module/CMakeLists.txt +++ b/tests/auto/cmake/test_concurrent_module/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_dbus_module/CMakeLists.txt b/tests/auto/cmake/test_dbus_module/CMakeLists.txt index 6159456197..a2f11ce59c 100644 --- a/tests/auto/cmake/test_dbus_module/CMakeLists.txt +++ b/tests/auto/cmake/test_dbus_module/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_dependent_modules/CMakeLists.txt b/tests/auto/cmake/test_dependent_modules/CMakeLists.txt index 679f7fed27..47b209f10b 100644 --- a/tests/auto/cmake/test_dependent_modules/CMakeLists.txt +++ b/tests/auto/cmake/test_dependent_modules/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_generating_cpp_exports/.cmake.conf b/tests/auto/cmake/test_generating_cpp_exports/.cmake.conf index f7a41402e0..377be0059e 100644 --- a/tests/auto/cmake/test_generating_cpp_exports/.cmake.conf +++ b/tests/auto/cmake/test_generating_cpp_exports/.cmake.conf @@ -1 +1 @@ -set(QT_REPO_MODULE_VERSION "6.4.0") +set(QT_REPO_MODULE_VERSION "6.5.0") diff --git a/tests/auto/cmake/test_generating_cpp_exports/CMakeLists.txt b/tests/auto/cmake/test_generating_cpp_exports/CMakeLists.txt index 7b5666c3f7..d2bb004714 100644 --- a/tests/auto/cmake/test_generating_cpp_exports/CMakeLists.txt +++ b/tests/auto/cmake/test_generating_cpp_exports/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) include(.cmake.conf) diff --git a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/CMakeLists.txt b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/CMakeLists.txt index 805bce2a93..0e699f5ba8 100644 --- a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/CMakeLists.txt +++ b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + qt_internal_add_module(TestAutogeneratingCppExports GENERATE_CPP_EXPORTS SOURCES diff --git a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/CMakeLists.txt b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/CMakeLists.txt index e1735a3f9f..059cb79610 100644 --- a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/CMakeLists.txt +++ b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + qt_internal_add_module(TestAutogeneratingCppExportsCustomName GENERATE_CPP_EXPORTS CPP_EXPORT_HEADER_BASE_NAME diff --git a/tests/auto/cmake/test_global_promotion/CMakeLists.txt b/tests/auto/cmake/test_global_promotion/CMakeLists.txt index 1ad6c5e7ad..7ec4c2e171 100644 --- a/tests/auto/cmake/test_global_promotion/CMakeLists.txt +++ b/tests/auto/cmake/test_global_promotion/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) project(global_promotion) diff --git a/tests/auto/cmake/test_global_promotion/subdir_with_global_qt/CMakeLists.txt b/tests/auto/cmake/test_global_promotion/subdir_with_global_qt/CMakeLists.txt index a8808a8c83..7d7bbb2dc5 100644 --- a/tests/auto/cmake/test_global_promotion/subdir_with_global_qt/CMakeLists.txt +++ b/tests/auto/cmake/test_global_promotion/subdir_with_global_qt/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + message(STATUS "Entered subdir_with_global_qt subdirectory") set(file_path "${CMAKE_CURRENT_BINARY_DIR}/lib.cpp") diff --git a/tests/auto/cmake/test_global_promotion/subdir_with_local_qt/CMakeLists.txt b/tests/auto/cmake/test_global_promotion/subdir_with_local_qt/CMakeLists.txt index 1bed5a2f99..0167e6fa49 100644 --- a/tests/auto/cmake/test_global_promotion/subdir_with_local_qt/CMakeLists.txt +++ b/tests/auto/cmake/test_global_promotion/subdir_with_local_qt/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + message(STATUS "Entered subdir_with_local_qt subdirectory") set(file_path "${CMAKE_CURRENT_BINARY_DIR}/lib.cpp") diff --git a/tests/auto/cmake/test_import_plugins/CMakeLists.txt b/tests/auto/cmake/test_import_plugins/CMakeLists.txt index be85af2091..81541b193d 100644 --- a/tests/auto/cmake/test_import_plugins/CMakeLists.txt +++ b/tests/auto/cmake/test_import_plugins/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) project(import_plugins_advanced) diff --git a/tests/auto/cmake/test_interface/CMakeLists.txt b/tests/auto/cmake/test_interface/CMakeLists.txt index 22e9a0b3ac..ab5b91e9cd 100644 --- a/tests/auto/cmake/test_interface/CMakeLists.txt +++ b/tests/auto/cmake/test_interface/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_interface/widget_test/CMakeLists.txt b/tests/auto/cmake/test_interface/widget_test/CMakeLists.txt index 229b1bf962..e977700304 100644 --- a/tests/auto/cmake/test_interface/widget_test/CMakeLists.txt +++ b/tests/auto/cmake/test_interface/widget_test/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) project(test_interface_try_compile) diff --git a/tests/auto/cmake/test_interface_link_libraries/CMakeLists.txt b/tests/auto/cmake/test_interface_link_libraries/CMakeLists.txt index 28f8b9aefe..6927e58ce2 100644 --- a/tests/auto/cmake/test_interface_link_libraries/CMakeLists.txt +++ b/tests/auto/cmake/test_interface_link_libraries/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_json_plugin_includes/CMakeLists.txt b/tests/auto/cmake/test_json_plugin_includes/CMakeLists.txt index 0f5dc99206..d7a49992bc 100644 --- a/tests/auto/cmake/test_json_plugin_includes/CMakeLists.txt +++ b/tests/auto/cmake/test_json_plugin_includes/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_moc_macro_target/CMakeLists.txt b/tests/auto/cmake/test_moc_macro_target/CMakeLists.txt index eaf8bda1bb..62ebc0f3ee 100644 --- a/tests/auto/cmake/test_moc_macro_target/CMakeLists.txt +++ b/tests/auto/cmake/test_moc_macro_target/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt b/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt index 48864f2b22..bfea83d9ec 100644 --- a/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt +++ b/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt b/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt index 61a273424e..878c0ac067 100644 --- a/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt +++ b/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + find_package(Qt6Core REQUIRED) diff --git a/tests/auto/cmake/test_opengl_lib/CMakeLists.txt b/tests/auto/cmake/test_opengl_lib/CMakeLists.txt index 020d7fbf2a..76bc62d37c 100644 --- a/tests/auto/cmake/test_opengl_lib/CMakeLists.txt +++ b/tests/auto/cmake/test_opengl_lib/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_platform_defs_include/CMakeLists.txt b/tests/auto/cmake/test_platform_defs_include/CMakeLists.txt index 34a22b056a..f813901207 100644 --- a/tests/auto/cmake/test_platform_defs_include/CMakeLists.txt +++ b/tests/auto/cmake/test_platform_defs_include/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_plugin_shared_static_flavor.cmake b/tests/auto/cmake/test_plugin_shared_static_flavor.cmake index a906bfebbc..a96e6a7acb 100644 --- a/tests/auto/cmake/test_plugin_shared_static_flavor.cmake +++ b/tests/auto/cmake/test_plugin_shared_static_flavor.cmake @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + _qt_internal_test_expect_pass(test_plugin_shared_static_flavor TESTNAME test_plugin_flavor_static BUILD_OPTIONS diff --git a/tests/auto/cmake/test_plugin_shared_static_flavor/CMakeLists.txt b/tests/auto/cmake/test_plugin_shared_static_flavor/CMakeLists.txt index 0a79038e8a..99cab0e33d 100644 --- a/tests/auto/cmake/test_plugin_shared_static_flavor/CMakeLists.txt +++ b/tests/auto/cmake/test_plugin_shared_static_flavor/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) project(test_plugin_flavor) diff --git a/tests/auto/cmake/test_plugins/CMakeLists.txt b/tests/auto/cmake/test_plugins/CMakeLists.txt index 9870db9ce4..5947c28364 100644 --- a/tests/auto/cmake/test_plugins/CMakeLists.txt +++ b/tests/auto/cmake/test_plugins/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_private_includes/CMakeLists.txt b/tests/auto/cmake/test_private_includes/CMakeLists.txt index 402ae73def..63a632c5b3 100644 --- a/tests/auto/cmake/test_private_includes/CMakeLists.txt +++ b/tests/auto/cmake/test_private_includes/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_private_targets/CMakeLists.txt b/tests/auto/cmake/test_private_targets/CMakeLists.txt index f703b7af20..897a15523b 100644 --- a/tests/auto/cmake/test_private_targets/CMakeLists.txt +++ b/tests/auto/cmake/test_private_targets/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_qt_extract_metatypes/CMakeLists.txt b/tests/auto/cmake/test_qt_extract_metatypes/CMakeLists.txt index 51d78dd833..1e2b439bb7 100644 --- a/tests/auto/cmake/test_qt_extract_metatypes/CMakeLists.txt +++ b/tests/auto/cmake/test_qt_extract_metatypes/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) project(test_qt_extract_metatypes VERSION 0.1 LANGUAGES CXX) diff --git a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/CMakeLists.txt b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/CMakeLists.txt index 88e51a0ed1..d0bdb1360c 100644 --- a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/CMakeLists.txt +++ b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) project(qt_extract_metatypes_test_project VERSION 0.1 LANGUAGES CXX) diff --git a/tests/auto/cmake/test_qtmainwin_library/CMakeLists.txt b/tests/auto/cmake/test_qtmainwin_library/CMakeLists.txt index 387fbd81f7..1503850863 100644 --- a/tests/auto/cmake/test_qtmainwin_library/CMakeLists.txt +++ b/tests/auto/cmake/test_qtmainwin_library/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_static_resources/.cmake.conf b/tests/auto/cmake/test_static_resources/.cmake.conf index f7a41402e0..377be0059e 100644 --- a/tests/auto/cmake/test_static_resources/.cmake.conf +++ b/tests/auto/cmake/test_static_resources/.cmake.conf @@ -1 +1 @@ -set(QT_REPO_MODULE_VERSION "6.4.0") +set(QT_REPO_MODULE_VERSION "6.5.0") diff --git a/tests/auto/cmake/test_static_resources/CMakeLists.txt b/tests/auto/cmake/test_static_resources/CMakeLists.txt index b159f43b78..21e59c56ba 100644 --- a/tests/auto/cmake/test_static_resources/CMakeLists.txt +++ b/tests/auto/cmake/test_static_resources/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) include(.cmake.conf) diff --git a/tests/auto/cmake/test_static_resources/mock_static_resources1/CMakeLists.txt b/tests/auto/cmake/test_static_resources/mock_static_resources1/CMakeLists.txt index 973f8b3279..dd5b7993df 100644 --- a/tests/auto/cmake/test_static_resources/mock_static_resources1/CMakeLists.txt +++ b/tests/auto/cmake/test_static_resources/mock_static_resources1/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + qt_internal_add_module(MockStaticResources1 STATIC PLUGIN_TYPES mockstaticresources diff --git a/tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/CMakeLists.txt b/tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/CMakeLists.txt index 99cb4a286e..13a70a22be 100644 --- a/tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/CMakeLists.txt +++ b/tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + qt_internal_add_plugin(TestInitResourcesStaticPlugin STATIC OUTPUT_NAME testinitresourcesstaticplugin diff --git a/tests/auto/cmake/test_static_resources/test_static_resources_propagation/CMakeLists.txt b/tests/auto/cmake/test_static_resources/test_static_resources_propagation/CMakeLists.txt index 44d4839084..375d58ea5c 100644 --- a/tests/auto/cmake/test_static_resources/test_static_resources_propagation/CMakeLists.txt +++ b/tests/auto/cmake/test_static_resources/test_static_resources_propagation/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # TODO: Revisit which of these tests makes sense to keep now that we depend on CMake 3.21 to # properly place object libraries object files on the link line. # See QTBUG-95601 diff --git a/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt b/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt index b6ac6434e8..a8faf47790 100644 --- a/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt +++ b/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_testlib_definitions/core_only/CMakeLists.txt b/tests/auto/cmake/test_testlib_definitions/core_only/CMakeLists.txt index cc68be18b8..a3c7c7e99a 100644 --- a/tests/auto/cmake/test_testlib_definitions/core_only/CMakeLists.txt +++ b/tests/auto/cmake/test_testlib_definitions/core_only/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + project(core_only) diff --git a/tests/auto/cmake/test_testlib_definitions/gui/CMakeLists.txt b/tests/auto/cmake/test_testlib_definitions/gui/CMakeLists.txt index 528ec7dc4e..566e63d26f 100644 --- a/tests/auto/cmake/test_testlib_definitions/gui/CMakeLists.txt +++ b/tests/auto/cmake/test_testlib_definitions/gui/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + project(gui) diff --git a/tests/auto/cmake/test_testlib_definitions/widgets/CMakeLists.txt b/tests/auto/cmake/test_testlib_definitions/widgets/CMakeLists.txt index 0dbf9139e6..34ff32d807 100644 --- a/tests/auto/cmake/test_testlib_definitions/widgets/CMakeLists.txt +++ b/tests/auto/cmake/test_testlib_definitions/widgets/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + project(widgets) diff --git a/tests/auto/cmake/test_testlib_no_link_gui/CMakeLists.txt b/tests/auto/cmake/test_testlib_no_link_gui/CMakeLists.txt index cc126ab87f..01b9b2f3f1 100644 --- a/tests/auto/cmake/test_testlib_no_link_gui/CMakeLists.txt +++ b/tests/auto/cmake/test_testlib_no_link_gui/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_testlib_no_link_widgets/CMakeLists.txt b/tests/auto/cmake/test_testlib_no_link_widgets/CMakeLists.txt index b88ad60d44..f42578d562 100644 --- a/tests/auto/cmake/test_testlib_no_link_widgets/CMakeLists.txt +++ b/tests/auto/cmake/test_testlib_no_link_widgets/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_umbrella_config/CMakeLists.txt b/tests/auto/cmake/test_umbrella_config/CMakeLists.txt index a7c31971fb..8210dc5b54 100644 --- a/tests/auto/cmake/test_umbrella_config/CMakeLists.txt +++ b/tests/auto/cmake/test_umbrella_config/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_umbrella_config/components_found/CMakeLists.txt b/tests/auto/cmake/test_umbrella_config/components_found/CMakeLists.txt index 999aaccdd2..2f9d81d9d8 100644 --- a/tests/auto/cmake/test_umbrella_config/components_found/CMakeLists.txt +++ b/tests/auto/cmake/test_umbrella_config/components_found/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # The module finds its dependencies find_package(Qt6 6.0.0 diff --git a/tests/auto/cmake/test_umbrella_config/components_not_found/CMakeLists.txt b/tests/auto/cmake/test_umbrella_config/components_not_found/CMakeLists.txt index aa56559c8f..7a3f4bf7cf 100644 --- a/tests/auto/cmake/test_umbrella_config/components_not_found/CMakeLists.txt +++ b/tests/auto/cmake/test_umbrella_config/components_not_found/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # The module finds its dependencies find_package(Qt6 diff --git a/tests/auto/cmake/test_versionless_targets/CMakeLists.txt b/tests/auto/cmake/test_versionless_targets/CMakeLists.txt index 278586fb1d..3c5f03297f 100644 --- a/tests/auto/cmake/test_versionless_targets/CMakeLists.txt +++ b/tests/auto/cmake/test_versionless_targets/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) project(versionless_targets) diff --git a/tests/auto/cmake/test_widgets_app_deployment/CMakeLists.txt b/tests/auto/cmake/test_widgets_app_deployment/CMakeLists.txt index aa30954f45..bfc09958ad 100644 --- a/tests/auto/cmake/test_widgets_app_deployment/CMakeLists.txt +++ b/tests/auto/cmake/test_widgets_app_deployment/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) project(deployment_api) enable_testing() diff --git a/tests/auto/cmake/test_wrap_cpp_and_resources/CMakeLists.txt b/tests/auto/cmake/test_wrap_cpp_and_resources/CMakeLists.txt index 8452bf8c91..6bfabc8d1d 100644 --- a/tests/auto/cmake/test_wrap_cpp_and_resources/CMakeLists.txt +++ b/tests/auto/cmake/test_wrap_cpp_and_resources/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/test_wrap_cpp_options/CMakeLists.txt b/tests/auto/cmake/test_wrap_cpp_options/CMakeLists.txt index 17f8fd7a48..1bb6ab41ad 100644 --- a/tests/auto/cmake/test_wrap_cpp_options/CMakeLists.txt +++ b/tests/auto/cmake/test_wrap_cpp_options/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + cmake_minimum_required(VERSION 3.16) diff --git a/tests/auto/cmake/tst_qaddpreroutine/CMakeLists.txt b/tests/auto/cmake/tst_qaddpreroutine/CMakeLists.txt index 96cd293c6f..d75b727f92 100644 --- a/tests/auto/cmake/tst_qaddpreroutine/CMakeLists.txt +++ b/tests/auto/cmake/tst_qaddpreroutine/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## tst_qaddpreroutine Test: ##################################################################### diff --git a/tests/auto/concurrent/CMakeLists.txt b/tests/auto/concurrent/CMakeLists.txt index 1d7b8cefb4..3e439bdacf 100644 --- a/tests/auto/concurrent/CMakeLists.txt +++ b/tests/auto/concurrent/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from concurrent.pro. add_subdirectory(qtconcurrentfilter) diff --git a/tests/auto/concurrent/qtconcurrentfilter/CMakeLists.txt b/tests/auto/concurrent/qtconcurrentfilter/CMakeLists.txt index f81bed27d6..cd268d6e04 100644 --- a/tests/auto/concurrent/qtconcurrentfilter/CMakeLists.txt +++ b/tests/auto/concurrent/qtconcurrentfilter/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qtconcurrentfilter.pro. ##################################################################### @@ -7,6 +10,6 @@ qt_internal_add_test(tst_qtconcurrentfilter SOURCES tst_qtconcurrentfilter.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Concurrent ) diff --git a/tests/auto/concurrent/qtconcurrentfiltermapgenerated/CMakeLists.txt b/tests/auto/concurrent/qtconcurrentfiltermapgenerated/CMakeLists.txt index 1933365e86..4fcaa36648 100644 --- a/tests/auto/concurrent/qtconcurrentfiltermapgenerated/CMakeLists.txt +++ b/tests/auto/concurrent/qtconcurrentfiltermapgenerated/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qtconcurrentfiltermapgenerated.pro. ##################################################################### @@ -8,6 +11,6 @@ qt_internal_add_test(tst_qtconcurrentfiltermapgenerated SOURCES tst_qtconcurrent_selected_tests.cpp tst_qtconcurrentfiltermapgenerated.cpp tst_qtconcurrentfiltermapgenerated.h - PUBLIC_LIBRARIES + LIBRARIES Qt::Concurrent ) diff --git a/tests/auto/concurrent/qtconcurrentiteratekernel/CMakeLists.txt b/tests/auto/concurrent/qtconcurrentiteratekernel/CMakeLists.txt index 2c74f6542e..83e4bf4cb5 100644 --- a/tests/auto/concurrent/qtconcurrentiteratekernel/CMakeLists.txt +++ b/tests/auto/concurrent/qtconcurrentiteratekernel/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qtconcurrentiteratekernel.pro. ##################################################################### @@ -7,6 +10,6 @@ qt_internal_add_test(tst_qtconcurrentiteratekernel SOURCES tst_qtconcurrentiteratekernel.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Concurrent ) diff --git a/tests/auto/concurrent/qtconcurrentmap/CMakeLists.txt b/tests/auto/concurrent/qtconcurrentmap/CMakeLists.txt index 20ccbdf374..6b6185ad82 100644 --- a/tests/auto/concurrent/qtconcurrentmap/CMakeLists.txt +++ b/tests/auto/concurrent/qtconcurrentmap/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qtconcurrentmap.pro. ##################################################################### @@ -7,7 +10,7 @@ qt_internal_add_test(tst_qtconcurrentmap SOURCES tst_qtconcurrentmap.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Concurrent ) diff --git a/tests/auto/concurrent/qtconcurrentmedian/CMakeLists.txt b/tests/auto/concurrent/qtconcurrentmedian/CMakeLists.txt index cbae4d1fb1..2ac6d1cbb3 100644 --- a/tests/auto/concurrent/qtconcurrentmedian/CMakeLists.txt +++ b/tests/auto/concurrent/qtconcurrentmedian/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qtconcurrentmedian.pro. ##################################################################### @@ -7,6 +10,6 @@ qt_internal_add_test(tst_qtconcurrentmedian SOURCES tst_qtconcurrentmedian.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Concurrent ) diff --git a/tests/auto/concurrent/qtconcurrentrun/CMakeLists.txt b/tests/auto/concurrent/qtconcurrentrun/CMakeLists.txt index 9f3b60481d..d1a814cd50 100644 --- a/tests/auto/concurrent/qtconcurrentrun/CMakeLists.txt +++ b/tests/auto/concurrent/qtconcurrentrun/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qtconcurrentrun.pro. ##################################################################### @@ -7,7 +10,7 @@ qt_internal_add_test(tst_qtconcurrentrun SOURCES tst_qtconcurrentrun.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Concurrent ) diff --git a/tests/auto/concurrent/qtconcurrenttask/CMakeLists.txt b/tests/auto/concurrent/qtconcurrenttask/CMakeLists.txt index 60f5cb47e3..3f3ac3f7a4 100644 --- a/tests/auto/concurrent/qtconcurrenttask/CMakeLists.txt +++ b/tests/auto/concurrent/qtconcurrenttask/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qtconcurrenttask.pro. ##################################################################### @@ -7,6 +10,6 @@ qt_internal_add_test(tst_qtconcurrenttask SOURCES tst_qtconcurrenttask.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Concurrent ) diff --git a/tests/auto/concurrent/qtconcurrentthreadengine/CMakeLists.txt b/tests/auto/concurrent/qtconcurrentthreadengine/CMakeLists.txt index 8a7f006674..0b6aceb32e 100644 --- a/tests/auto/concurrent/qtconcurrentthreadengine/CMakeLists.txt +++ b/tests/auto/concurrent/qtconcurrentthreadengine/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qtconcurrentthreadengine.pro. ##################################################################### @@ -7,6 +10,6 @@ qt_internal_add_test(tst_qtconcurrentthreadengine SOURCES tst_qtconcurrentthreadengine.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Concurrent ) diff --git a/tests/auto/corelib/CMakeLists.txt b/tests/auto/corelib/CMakeLists.txt index b9bf269745..46bcd59372 100644 --- a/tests/auto/corelib/CMakeLists.txt +++ b/tests/auto/corelib/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from corelib.pro. add_subdirectory(kernel) diff --git a/tests/auto/corelib/animation/CMakeLists.txt b/tests/auto/corelib/animation/CMakeLists.txt index 79c2d6c4e9..990a0d8474 100644 --- a/tests/auto/corelib/animation/CMakeLists.txt +++ b/tests/auto/corelib/animation/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from animation.pro. add_subdirectory(qabstractanimation) diff --git a/tests/auto/corelib/animation/qabstractanimation/CMakeLists.txt b/tests/auto/corelib/animation/qabstractanimation/CMakeLists.txt index 1ab378546d..1570490e9a 100644 --- a/tests/auto/corelib/animation/qabstractanimation/CMakeLists.txt +++ b/tests/auto/corelib/animation/qabstractanimation/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qabstractanimation.pro. ##################################################################### diff --git a/tests/auto/corelib/animation/qanimationgroup/CMakeLists.txt b/tests/auto/corelib/animation/qanimationgroup/CMakeLists.txt index 5dcdf49836..097d2cf613 100644 --- a/tests/auto/corelib/animation/qanimationgroup/CMakeLists.txt +++ b/tests/auto/corelib/animation/qanimationgroup/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qanimationgroup.pro. ##################################################################### diff --git a/tests/auto/corelib/animation/qparallelanimationgroup/CMakeLists.txt b/tests/auto/corelib/animation/qparallelanimationgroup/CMakeLists.txt index 9a6c9f45db..4b61ab0c4c 100644 --- a/tests/auto/corelib/animation/qparallelanimationgroup/CMakeLists.txt +++ b/tests/auto/corelib/animation/qparallelanimationgroup/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qparallelanimationgroup.pro. ##################################################################### diff --git a/tests/auto/corelib/animation/qpauseanimation/CMakeLists.txt b/tests/auto/corelib/animation/qpauseanimation/CMakeLists.txt index bc846d33e7..48be888ebd 100644 --- a/tests/auto/corelib/animation/qpauseanimation/CMakeLists.txt +++ b/tests/auto/corelib/animation/qpauseanimation/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qpauseanimation.pro. ##################################################################### @@ -7,6 +10,6 @@ qt_internal_add_test(tst_qpauseanimation SOURCES tst_qpauseanimation.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate ) diff --git a/tests/auto/corelib/animation/qpropertyanimation/CMakeLists.txt b/tests/auto/corelib/animation/qpropertyanimation/CMakeLists.txt index 89a4d0a8e1..89ae7a0ed2 100644 --- a/tests/auto/corelib/animation/qpropertyanimation/CMakeLists.txt +++ b/tests/auto/corelib/animation/qpropertyanimation/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qpropertyanimation.pro. ##################################################################### @@ -7,7 +10,7 @@ qt_internal_add_test(tst_qpropertyanimation SOURCES tst_qpropertyanimation.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate Qt::Gui Qt::Widgets diff --git a/tests/auto/corelib/animation/qsequentialanimationgroup/CMakeLists.txt b/tests/auto/corelib/animation/qsequentialanimationgroup/CMakeLists.txt index e56f9f6ff8..5a9b95c296 100644 --- a/tests/auto/corelib/animation/qsequentialanimationgroup/CMakeLists.txt +++ b/tests/auto/corelib/animation/qsequentialanimationgroup/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qsequentialanimationgroup.pro. ##################################################################### diff --git a/tests/auto/corelib/animation/qvariantanimation/CMakeLists.txt b/tests/auto/corelib/animation/qvariantanimation/CMakeLists.txt index 08fd743e33..a138d7d090 100644 --- a/tests/auto/corelib/animation/qvariantanimation/CMakeLists.txt +++ b/tests/auto/corelib/animation/qvariantanimation/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qvariantanimation.pro. ##################################################################### diff --git a/tests/auto/corelib/global/CMakeLists.txt b/tests/auto/corelib/global/CMakeLists.txt index fe63402288..bec44139de 100644 --- a/tests/auto/corelib/global/CMakeLists.txt +++ b/tests/auto/corelib/global/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from global.pro. if(NOT INTEGRITY) add_subdirectory(qcompare) @@ -21,3 +24,4 @@ add_subdirectory(qoperatingsystemversion) if(WIN32) add_subdirectory(qwinregistry) endif() +add_subdirectory(qxp) diff --git a/tests/auto/corelib/global/q_func_info/CMakeLists.txt b/tests/auto/corelib/global/q_func_info/CMakeLists.txt index 93257c31de..d673ec99f9 100644 --- a/tests/auto/corelib/global/q_func_info/CMakeLists.txt +++ b/tests/auto/corelib/global/q_func_info/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from q_func_info.pro. ##################################################################### diff --git a/tests/auto/corelib/global/qcompare/CMakeLists.txt b/tests/auto/corelib/global/qcompare/CMakeLists.txt index 0fbf696d0e..8cf2c32cba 100644 --- a/tests/auto/corelib/global/qcompare/CMakeLists.txt +++ b/tests/auto/corelib/global/qcompare/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qcompare.pro. ##################################################################### diff --git a/tests/auto/corelib/global/qflags/CMakeLists.txt b/tests/auto/corelib/global/qflags/CMakeLists.txt index 8ba02d93b4..5279658430 100644 --- a/tests/auto/corelib/global/qflags/CMakeLists.txt +++ b/tests/auto/corelib/global/qflags/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## tst_qflags Test: ##################################################################### diff --git a/tests/auto/corelib/global/qfloat16/CMakeLists.txt b/tests/auto/corelib/global/qfloat16/CMakeLists.txt index 1dbc95ec95..0f6dfd544b 100644 --- a/tests/auto/corelib/global/qfloat16/CMakeLists.txt +++ b/tests/auto/corelib/global/qfloat16/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qfloat16.pro. ##################################################################### @@ -7,6 +10,6 @@ qt_internal_add_test(tst_qfloat16 SOURCES tst_qfloat16.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::TestPrivate ) diff --git a/tests/auto/corelib/global/qgetputenv/CMakeLists.txt b/tests/auto/corelib/global/qgetputenv/CMakeLists.txt index 79d45c58b0..92a26ae90a 100644 --- a/tests/auto/corelib/global/qgetputenv/CMakeLists.txt +++ b/tests/auto/corelib/global/qgetputenv/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qgetputenv.pro. ##################################################################### diff --git a/tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp b/tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp index 77a7fa4194..f914ee5f23 100644 --- a/tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp +++ b/tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp @@ -60,7 +60,11 @@ void tst_QGetPutEnv::getSetCheck() QCOMPARE(sresult, QString()); #endif - QVERIFY(qputenv(varName, QByteArray("supervalue"))); + constexpr char varValueFullString[] = "supervalue123"; + const auto varValueQBA = QByteArray::fromRawData(varValueFullString, sizeof varValueFullString - 4); + QCOMPARE_EQ(varValueQBA, "supervalue"); + + QVERIFY(qputenv(varName, varValueQBA)); QVERIFY(qEnvironmentVariableIsSet(varName)); QVERIFY(!qEnvironmentVariableIsEmpty(varName)); diff --git a/tests/auto/corelib/global/qglobal/CMakeLists.txt b/tests/auto/corelib/global/qglobal/CMakeLists.txt index de9a94629a..4b390c8909 100644 --- a/tests/auto/corelib/global/qglobal/CMakeLists.txt +++ b/tests/auto/corelib/global/qglobal/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qglobal.pro. ##################################################################### diff --git a/tests/auto/corelib/global/qglobal/qglobal.c b/tests/auto/corelib/global/qglobal/qglobal.c index 4d4f4475ea..3b898de39f 100644 --- a/tests/auto/corelib/global/qglobal/qglobal.c +++ b/tests/auto/corelib/global/qglobal/qglobal.c @@ -51,7 +51,8 @@ int tst_QtVersion() return QT_VERSION; } -const char *tst_qVersion() Q_DECL_NOEXCEPT +const char *tst_qVersion() Q_DECL_NOEXCEPT; +const char *tst_qVersion() { #if !defined(QT_NAMESPACE) return qVersion(); diff --git a/tests/auto/corelib/global/qglobalstatic/CMakeLists.txt b/tests/auto/corelib/global/qglobalstatic/CMakeLists.txt index ea978bdadb..132eb861e3 100644 --- a/tests/auto/corelib/global/qglobalstatic/CMakeLists.txt +++ b/tests/auto/corelib/global/qglobalstatic/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qglobalstatic.pro. ##################################################################### @@ -8,7 +11,7 @@ qt_internal_add_test(tst_qglobalstatic EXCEPTIONS SOURCES tst_qglobalstatic.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate Qt::TestPrivate ) diff --git a/tests/auto/corelib/global/qhooks/CMakeLists.txt b/tests/auto/corelib/global/qhooks/CMakeLists.txt index c8d6f1a769..8f203f1792 100644 --- a/tests/auto/corelib/global/qhooks/CMakeLists.txt +++ b/tests/auto/corelib/global/qhooks/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qhooks.pro. ##################################################################### @@ -7,6 +10,6 @@ qt_internal_add_test(tst_qhooks SOURCES tst_qhooks.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate ) diff --git a/tests/auto/corelib/global/qkeycombination/CMakeLists.txt b/tests/auto/corelib/global/qkeycombination/CMakeLists.txt index 9553a35dea..c4969fd15d 100644 --- a/tests/auto/corelib/global/qkeycombination/CMakeLists.txt +++ b/tests/auto/corelib/global/qkeycombination/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qkeycombination.pro. ##################################################################### diff --git a/tests/auto/corelib/global/qlogging/CMakeLists.txt b/tests/auto/corelib/global/qlogging/CMakeLists.txt index a9950d3414..d3cdad9552 100644 --- a/tests/auto/corelib/global/qlogging/CMakeLists.txt +++ b/tests/auto/corelib/global/qlogging/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qlogging.pro. # This file is almost completely custom written # special case skip regeneration diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp index 5de7830113..df0cb5ae77 100644 --- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp +++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp @@ -727,9 +727,19 @@ void tst_qmessagehandler::qMessagePattern_data() QSKIP("These test cases don't work with static Qt builds"); #else #ifndef QT_NO_DEBUG - QTest::newRow("backtrace") << "[%{backtrace}] %{message}" << true << (QList<QByteArray>() - // MyClass::qt_static_metacall is explicitly marked as hidden in the Q_OBJECT macro - << "[MyClass::myFunction|MyClass::mySlot1|?" BACKTRACE_HELPER_NAME "?|" QT_NAMESPACE_STR "QMetaMethod::invoke|" QT_NAMESPACE_STR "QMetaObject::invokeMethod] from_a_function 34"); + QList<QByteArray> expectedBacktrace = { + // MyClass::qt_static_metacall is explicitly marked as hidden in the + // Q_OBJECT macro hence the ?helper? frame + "[MyClass::myFunction|MyClass::mySlot1|?" BACKTRACE_HELPER_NAME "?|", + + // QMetaObject::invokeMethod calls internal function + // (QMetaMethodPrivate::invokeImpl, at the tims of this writing), which + // will usually show only as ?libQt6Core.so? or equivalent, so we skip + + // end of backtrace, actual message + "|" QT_NAMESPACE_STR "QMetaObject::invokeMethod] from_a_function 34" + }; + QTest::newRow("backtrace") << "[%{backtrace}] %{message}" << true << expectedBacktrace; #endif QTest::newRow("backtrace depth,separator") << "[%{backtrace depth=2 separator=\"\n\"}] %{message}" << true << (QList<QByteArray>() diff --git a/tests/auto/corelib/global/qnativeinterface/CMakeLists.txt b/tests/auto/corelib/global/qnativeinterface/CMakeLists.txt index 52242b4292..7536eb3d3c 100644 --- a/tests/auto/corelib/global/qnativeinterface/CMakeLists.txt +++ b/tests/auto/corelib/global/qnativeinterface/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + qt_internal_add_test(tst_qnativeinterface SOURCES tst_qnativeinterface.cpp diff --git a/tests/auto/corelib/global/qnumeric/CMakeLists.txt b/tests/auto/corelib/global/qnumeric/CMakeLists.txt index f86ddffc1d..e079419110 100644 --- a/tests/auto/corelib/global/qnumeric/CMakeLists.txt +++ b/tests/auto/corelib/global/qnumeric/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qnumeric.pro. ##################################################################### @@ -7,7 +10,7 @@ qt_internal_add_test(tst_qnumeric SOURCES tst_qnumeric.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate ) diff --git a/tests/auto/corelib/global/qoperatingsystemversion/CMakeLists.txt b/tests/auto/corelib/global/qoperatingsystemversion/CMakeLists.txt index 619297fdab..37f83435b1 100644 --- a/tests/auto/corelib/global/qoperatingsystemversion/CMakeLists.txt +++ b/tests/auto/corelib/global/qoperatingsystemversion/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qoperatingsystemversion.pro. ##################################################################### diff --git a/tests/auto/corelib/global/qrandomgenerator/CMakeLists.txt b/tests/auto/corelib/global/qrandomgenerator/CMakeLists.txt index 54fa36b5df..bc7af5c778 100644 --- a/tests/auto/corelib/global/qrandomgenerator/CMakeLists.txt +++ b/tests/auto/corelib/global/qrandomgenerator/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qrandomgenerator.pro. ##################################################################### @@ -7,6 +10,6 @@ qt_internal_add_test(tst_qrandomgenerator SOURCES tst_qrandomgenerator.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate ) diff --git a/tests/auto/corelib/global/qrandomgenerator/tst_qrandomgenerator.cpp b/tests/auto/corelib/global/qrandomgenerator/tst_qrandomgenerator.cpp index a3b31eda3f..9ada7352b4 100644 --- a/tests/auto/corelib/global/qrandomgenerator/tst_qrandomgenerator.cpp +++ b/tests/auto/corelib/global/qrandomgenerator/tst_qrandomgenerator.cpp @@ -14,7 +14,6 @@ # define HAVE_FALLBACK_ENGINE #endif -#define COMMA , #define QVERIFY_3TIMES(statement) \ do {\ if (!static_cast<bool>(statement))\ @@ -165,8 +164,8 @@ QT_WARNING_POP QRandomGenerator64 systemRng64 = *system64; systemRng64 = *system64; - static_assert(std::is_same<decltype(rng64.generate()) COMMA quint64>::value); - static_assert(std::is_same<decltype(system64->generate()) COMMA quint64>::value); + static_assert(std::is_same_v<decltype(rng64.generate()), quint64>); + static_assert(std::is_same_v<decltype(system64->generate()), quint64>); } void tst_QRandomGenerator::knownSequence() @@ -895,18 +894,20 @@ void tst_QRandomGenerator::stdGenerateCanonical() { QFETCH(uint, control); RandomGenerator rng(control); + auto generate_canonical = [&rng]() { + return std::generate_canonical<qreal, 32>(rng); + }; for (int i = 0; i < 4; ++i) { QVERIFY_3TIMES([&] { - qreal value = std::generate_canonical<qreal COMMA 32>(rng); + qreal value = generate_canonical(); return value > 0 && value < 1 && value != RandomValueFP; }()); } // and should hopefully be different from repeated calls for (int i = 0; i < 4; ++i) - QVERIFY_3TIMES(std::generate_canonical<qreal COMMA 32>(rng) != - std::generate_canonical<qreal COMMA 32>(rng)); + QVERIFY_3TIMES(generate_canonical() != generate_canonical()); } void tst_QRandomGenerator::stdUniformRealDistribution_data() diff --git a/tests/auto/corelib/global/qtendian/CMakeLists.txt b/tests/auto/corelib/global/qtendian/CMakeLists.txt index acd0981991..cc72e6f449 100644 --- a/tests/auto/corelib/global/qtendian/CMakeLists.txt +++ b/tests/auto/corelib/global/qtendian/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qtendian.pro. ##################################################################### @@ -7,6 +10,6 @@ qt_internal_add_test(tst_qtendian SOURCES tst_qtendian.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate ) diff --git a/tests/auto/corelib/global/qtendian/tst_qtendian.cpp b/tests/auto/corelib/global/qtendian/tst_qtendian.cpp index 7f13559067..401367ecaa 100644 --- a/tests/auto/corelib/global/qtendian/tst_qtendian.cpp +++ b/tests/auto/corelib/global/qtendian/tst_qtendian.cpp @@ -35,8 +35,6 @@ private slots: void endianIntegers_data(); void endianIntegers(); - void endianBitfields(); - void endianBitfieldUnions_data(); void endianBitfieldUnions(); }; @@ -344,41 +342,15 @@ void tst_QtEndian::endianIntegers() #endif } -void tst_QtEndian::endianBitfields() -{ - union { - quint32_be_bitfield<21, 11> upper; - quint32_be_bitfield<10, 11> lower; - qint32_be_bitfield<0, 10> bottom; - } u; - - u.upper = 200; - QCOMPARE(u.upper, 200U); - u.lower = 1000; - u.bottom = -8; - QCOMPARE(u.lower, 1000U); - QCOMPARE(u.upper, 200U); - - u.lower += u.upper; - QCOMPARE(u.upper, 200U); - QCOMPARE(u.lower, 1200U); - - u.upper = 65536 + 7; - u.lower = 65535; - QCOMPARE(u.lower, 65535U & ((1<<11) - 1)); - QCOMPARE(u.upper, 7U); - - QCOMPARE(u.bottom, -8); -} - template<template<typename... Accessors> typename Union, template<int, int, typename> typename Member> void testBitfieldUnion() { using upper = Member<21, 11, uint>; using lower = Member<10, 11, uint>; using bottom = Member<0, 10, int>; + using all = Member<0, 32, uint>; - using UnionType = Union<upper, lower, bottom>; + using UnionType = Union<upper, lower, bottom, all>; UnionType u; u.template set<upper>(200); @@ -402,6 +374,15 @@ void testBitfieldUnion() UnionType u2(QSpecialIntegerBitfieldZero); QCOMPARE(u2.data(), 0U); + u2.template set<all>(std::numeric_limits<uint>::max()); + QCOMPARE(u2.template get<all>(), std::numeric_limits<uint>::max()); + + u2.template set<all>(453); + QCOMPARE(u2.template get<all>(), 453U); + + u2.template set<all>(0); + QCOMPARE(u2.template get<all>(), 0U); + UnionType u3(42U); QCOMPARE(u3.data(), 42U); diff --git a/tests/auto/corelib/global/qwinregistry/CMakeLists.txt b/tests/auto/corelib/global/qwinregistry/CMakeLists.txt index 95d591a125..6fdeeeb80f 100644 --- a/tests/auto/corelib/global/qwinregistry/CMakeLists.txt +++ b/tests/auto/corelib/global/qwinregistry/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qwinregistry.pro. ##################################################################### @@ -7,6 +10,6 @@ qt_internal_add_test(tst_qwinregistry SOURCES tst_qwinregistry.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate ) diff --git a/tests/auto/corelib/global/qxp/CMakeLists.txt b/tests/auto/corelib/global/qxp/CMakeLists.txt new file mode 100644 index 0000000000..f289a04701 --- /dev/null +++ b/tests/auto/corelib/global/qxp/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(function_ref) diff --git a/tests/auto/corelib/global/qxp/function_ref/CMakeLists.txt b/tests/auto/corelib/global/qxp/function_ref/CMakeLists.txt new file mode 100644 index 0000000000..8d489f0ffc --- /dev/null +++ b/tests/auto/corelib/global/qxp/function_ref/CMakeLists.txt @@ -0,0 +1,10 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +qt_internal_add_test(tst_qxp_function_ref + EXCEPTIONS + SOURCES + tst_qxp_function_ref.cpp + LIBRARIES + Qt::Core +) diff --git a/tests/auto/corelib/global/qxp/function_ref/tst_qxp_function_ref.cpp b/tests/auto/corelib/global/qxp/function_ref/tst_qxp_function_ref.cpp new file mode 100644 index 0000000000..6264e6a5ae --- /dev/null +++ b/tests/auto/corelib/global/qxp/function_ref/tst_qxp_function_ref.cpp @@ -0,0 +1,279 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include <QtCore/qxpfunctional.h> + +#include <QTest> + +#include <type_traits> + +// checking dependency q20::remove_cvref_t: +#define CHECK(in, out) \ + static_assert(std::is_same_v<q20::remove_cvref_t< in >, out >) +CHECK(int, int); +CHECK(const int, int); +CHECK(int &, int); +CHECK(const int &, int); +CHECK(int &&, int); +CHECK(const int &&, int); +CHECK(int *, int *); +CHECK(const int *, const int *); +CHECK(int[4], int[4]); +CHECK(const int (&)[4], int[4]); +#undef CHECK + +template <typename T> constexpr inline bool +is_noexcept_function_ref_helper_v = false; +template <typename R, typename...Args> constexpr inline bool +is_noexcept_function_ref_helper_v<qxp::function_ref<R(Args...) noexcept(true)>> = true; +template <typename R, typename...Args> constexpr inline bool +is_noexcept_function_ref_helper_v<qxp::function_ref<R(Args...) const noexcept(true)>> = true; + +template <typename T> constexpr inline bool +is_noexcept_function_ref_v = is_noexcept_function_ref_helper_v<q20::remove_cvref_t<T>>; + +class tst_qxp_function_ref : public QObject +{ + Q_OBJECT +public: + using QObject::QObject; + +private Q_SLOTS: + void basics(); + void constOverloads(); + void constExpr(); + void voidReturning(); + void ctad(); +}; + +void tst_qxp_function_ref::basics() +{ + static_assert(std::is_trivially_copyable_v<qxp::function_ref<int(int)>>); + static_assert(std::is_trivially_copyable_v<qxp::function_ref<int()>>); + static_assert(std::is_trivially_copyable_v<qxp::function_ref<void()>>); + + { + Q_CONSTINIT static int invoked = 0; + auto lambda = [](int i) noexcept { ++invoked; return i; }; + const qxp::function_ref<int(int)> f = lambda; + QCOMPARE(invoked, 0); + QCOMPARE(f(42), 42); + QCOMPARE(invoked, 1); + + const int fourtyTwo = 42; + + const qxp::function_ref<int(int) noexcept> f2 = std::move(lambda); + QCOMPARE(invoked, 1); + QCOMPARE(f2(fourtyTwo), 42); + QCOMPARE(invoked, 2); + + int (*fpr)(int) = lambda; + + const qxp::function_ref f3 = fpr; + static_assert(!is_noexcept_function_ref_v<decltype(f3)>); + QCOMPARE(invoked, 2); + QCOMPARE(f3(42), 42); + QCOMPARE(invoked, 3); + + int (*fpr2)(int) noexcept = lambda; + + const qxp::function_ref f4 = fpr2; + static_assert(is_noexcept_function_ref_v<decltype(f4)>); + QCOMPARE(invoked, 3); + QCOMPARE(f4(42), 42); + QCOMPARE(invoked, 4); + } + { + Q_CONSTINIT static int invoked = 0; + auto lambda = [] { ++invoked; return 42; }; + const qxp::function_ref<int()> f = lambda; + QCOMPARE(invoked, 0); + QCOMPARE(f(), 42); + QCOMPARE(invoked, 1); + + const qxp::function_ref<int()> f2 = std::move(lambda); + QCOMPARE(invoked, 1); + QCOMPARE(f2(), 42); + QCOMPARE(invoked, 2); + + int (*fpr)() = lambda; + + const qxp::function_ref f3 = fpr; + static_assert(!is_noexcept_function_ref_v<decltype(f3)>); + QCOMPARE(invoked, 2); + QCOMPARE(f3(), 42); + QCOMPARE(invoked, 3); + } + { + Q_CONSTINIT static int invoked = 0; + auto lambda = [] { ++invoked; }; + const qxp::function_ref<void()> f = lambda; + QCOMPARE(invoked, 0); + f(); + QCOMPARE(invoked, 1); + + const qxp::function_ref<void()> f2 = std::move(lambda); + QCOMPARE(invoked, 1); + f2(); + QCOMPARE(invoked, 2); + + void (*fpr)() = lambda; + + const qxp::function_ref f3 = fpr; + QCOMPARE(invoked, 2); + f3(); + QCOMPARE(invoked, 3); + } +} + +void tst_qxp_function_ref::constOverloads() +{ + auto func_c = [](qxp::function_ref<int() const> callable) + { + return callable(); + }; + auto func_m = [](qxp::function_ref<int() /*mutable*/> callable) + { + return callable(); + }; + + struct S + { + int operator()() { return 1; } + int operator()() const { return 2; } + }; + S s; + QCOMPARE(func_c(s), 2); + QCOMPARE(func_m(s), 1); + const S cs; + QCOMPARE(func_c(cs), 2); +#if 0 + // this should not compile (and doesn't, but currently fails with an error in the impl, + // not by failing a constructor constaint → spec issue?). + QCOMPARE(func_m(cs), 2); +#endif +} + +void tst_qxp_function_ref::constExpr() +{ + Q_CONSTINIT static int invoked = 0; + { + Q_CONSTINIT static auto lambda = [] (int i) { ++invoked; return i; }; + // the function object constructor is constexpr, so this should be constinit: + Q_CONSTINIT static qxp::function_ref<int(int)> f = lambda; + + QCOMPARE(invoked, 0); + QCOMPARE(f(15), 15); + QCOMPARE(invoked, 1); + } + { + constexpr static auto lambda = [] (int i) { ++invoked; return i; }; + // the function object constructor is constexpr, so this should be constinit: + Q_CONSTINIT static qxp::function_ref<int(int) const> f = lambda; + + QCOMPARE(invoked, 1); + QCOMPARE(f(51), 51); + QCOMPARE(invoked, 2); + +#if 0 // ### should this work?: + Q_CONSTINIT static qxp::function_ref<int(int)> f2 = lambda; + + QCOMPARE(invoked, 2); + QCOMPARE(f(150), 150); + QCOMPARE(invoked, 3); +#endif + + } +} + +int i_f_i_nx(int i) noexcept { return i; } +void v_f_i_nx(int) noexcept {} +int i_f_v_nx() noexcept { return 42; } +void v_f_v_nx() noexcept {} + +int i_f_i_ex(int i) { return i; } +void v_f_i_ex(int) {} +int i_f_v_ex() { return 42; } +void v_f_v_ex() {} + +void tst_qxp_function_ref::voidReturning() +{ + // check that "casting" int to void returns works: + + using Fi = qxp::function_ref<void(int)>; + using Fv = qxp::function_ref<void()>; + + { + Fi fi = i_f_i_nx; + fi(42); + Fv fv = i_f_v_nx; + fv(); + } + + { + Fi fi = i_f_i_ex; + fi(42); + Fv fv = i_f_v_ex; + fv(); + } + + // now with lambdas + + bool ok = false; // prevent lambdas from decaying to function pointers + { + auto lambda1 = [&](int i) noexcept { return i + int(ok); }; + Fi fi = lambda1; + fi(42); + auto lambda2 = [&]() noexcept { return int(ok); }; + Fv fv = lambda2; + fv(); + } + + { + auto lambda1 = [&](int i) { return i + int(ok); }; + Fi fi = lambda1; + fi(42); + auto lambda2 = [&]() { return int(ok); }; + Fv fv = lambda2; + fv(); + } +} + +void tst_qxp_function_ref::ctad() +{ +#define CHECK(fun, sig) \ + do { \ + qxp::function_ref f = fun; \ + static_assert(std::is_same_v<decltype(f), \ + qxp::function_ref<sig>>); \ + qxp::function_ref f2 = &fun; \ + static_assert(std::is_same_v<decltype(f2), \ + qxp::function_ref<sig>>); \ + } while (false) + + CHECK(i_f_i_nx, int (int) noexcept); + CHECK(v_f_i_nx, void(int) noexcept); + CHECK(i_f_v_nx, int ( ) noexcept); + CHECK(v_f_v_nx, void( ) noexcept); + + CHECK(i_f_i_ex, int (int)); + CHECK(v_f_i_ex, void(int)); + CHECK(i_f_v_ex, int ( )); + CHECK(v_f_v_ex, void( )); + +#undef CHECK + +#if 0 // no deduction guides for the non-function-pointer case, so no CTAD for lambdas + { + auto lambda = [](int i) -> int { return i; }; + qxp::function_ref f = lambda; + static_assert(std::is_same_v<decltype(f), + qxp::function_ref<int(int)>>); + } +#endif +} + + +QTEST_APPLESS_MAIN(tst_qxp_function_ref); + +#include "tst_qxp_function_ref.moc" diff --git a/tests/auto/corelib/io/CMakeLists.txt b/tests/auto/corelib/io/CMakeLists.txt index f4cfc16f06..a6af242fab 100644 --- a/tests/auto/corelib/io/CMakeLists.txt +++ b/tests/auto/corelib/io/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from io.pro. # There is no mounted filesystem for IO testing on INTEGRITY yet. if(INTEGRITY) diff --git a/tests/auto/corelib/io/largefile/CMakeLists.txt b/tests/auto/corelib/io/largefile/CMakeLists.txt index a82aa0c985..7968e09efc 100644 --- a/tests/auto/corelib/io/largefile/CMakeLists.txt +++ b/tests/auto/corelib/io/largefile/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from largefile.pro. ##################################################################### @@ -7,6 +10,6 @@ qt_internal_add_test(tst_largefile SOURCES tst_largefile.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::TestPrivate ) diff --git a/tests/auto/corelib/io/qabstractfileengine/CMakeLists.txt b/tests/auto/corelib/io/qabstractfileengine/CMakeLists.txt index 7e3b79403d..3b0402b2e3 100644 --- a/tests/auto/corelib/io/qabstractfileengine/CMakeLists.txt +++ b/tests/auto/corelib/io/qabstractfileengine/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qabstractfileengine.pro. ##################################################################### @@ -7,7 +10,7 @@ qt_internal_add_test(tst_qabstractfileengine SOURCES tst_qabstractfileengine.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate ) diff --git a/tests/auto/corelib/io/qbuffer/CMakeLists.txt b/tests/auto/corelib/io/qbuffer/CMakeLists.txt index 7d57d78b3f..661bad7866 100644 --- a/tests/auto/corelib/io/qbuffer/CMakeLists.txt +++ b/tests/auto/corelib/io/qbuffer/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qbuffer.pro. ##################################################################### diff --git a/tests/auto/corelib/io/qdataurl/CMakeLists.txt b/tests/auto/corelib/io/qdataurl/CMakeLists.txt index b13a235d3b..80c26d9e4b 100644 --- a/tests/auto/corelib/io/qdataurl/CMakeLists.txt +++ b/tests/auto/corelib/io/qdataurl/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qdataurl.pro. ##################################################################### @@ -7,6 +10,6 @@ qt_internal_add_test(tst_qdataurl SOURCES tst_qdataurl.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate ) diff --git a/tests/auto/corelib/io/qdebug/CMakeLists.txt b/tests/auto/corelib/io/qdebug/CMakeLists.txt index 067e3be04b..3a88b461c0 100644 --- a/tests/auto/corelib/io/qdebug/CMakeLists.txt +++ b/tests/auto/corelib/io/qdebug/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qdebug.pro. ##################################################################### @@ -7,7 +10,7 @@ qt_internal_add_test(tst_qdebug SOURCES tst_qdebug.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Concurrent ) diff --git a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp index 400625ba7d..7be4c92002 100644 --- a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp +++ b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp @@ -14,8 +14,12 @@ #include <QLine> #include <QMimeType> #include <QMimeDatabase> +#include <QMetaType> + +using namespace Qt::StringLiterals; static_assert(QTypeTraits::has_ostream_operator_v<QDebug, int>); +static_assert(QTypeTraits::has_ostream_operator_v<QDebug, QMetaType>); static_assert(QTypeTraits::has_ostream_operator_v<QDebug, QList<int>>); static_assert(QTypeTraits::has_ostream_operator_v<QDebug, QMap<int, QString>>); struct NonStreamable {}; @@ -54,6 +58,7 @@ private slots: void stateSaver() const; void veryLongWarningMessage() const; void qDebugQChar() const; + void qDebugQMetaType() const; void qDebugQString() const; void qDebugQStringView() const; void qDebugQUtf8StringView() const; @@ -428,6 +433,25 @@ void tst_QDebug::qDebugQChar() const } +void tst_QDebug::qDebugQMetaType() const +{ + QString file, function; + int line = 0; + MessageHandlerSetter mhs(myMessageHandler); + { + QDebug d = qDebug(); + d << QMetaType::fromType<int>() << QMetaType::fromType<QString>(); + } +#ifndef QT_NO_MESSAGELOGCONTEXT + file = __FILE__; line = __LINE__ - 4; function = Q_FUNC_INFO; +#endif + QCOMPARE(s_msgType, QtDebugMsg); + QCOMPARE(s_msg, R"(QMetaType(int) QMetaType(QString))"_L1); + QCOMPARE(QString::fromLatin1(s_file), file); + QCOMPARE(s_line, line); + QCOMPARE(QString::fromLatin1(s_function), function); +} + void tst_QDebug::qDebugQString() const { /* Use a basic string. */ diff --git a/tests/auto/corelib/io/qdir/CMakeLists.txt b/tests/auto/corelib/io/qdir/CMakeLists.txt index ee24703bd3..f93879c39a 100644 --- a/tests/auto/corelib/io/qdir/CMakeLists.txt +++ b/tests/auto/corelib/io/qdir/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qdir.pro. ##################################################################### @@ -16,7 +19,7 @@ list(APPEND test_data "tst_qdir.cpp") qt_internal_add_test(tst_qdir SOURCES tst_qdir.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate TESTDATA ${test_data} ) diff --git a/tests/auto/corelib/io/qdir/testdir/dir/CMakeLists.txt b/tests/auto/corelib/io/qdir/testdir/dir/CMakeLists.txt index 92ce7b4e89..1bdf3809b2 100644 --- a/tests/auto/corelib/io/qdir/testdir/dir/CMakeLists.txt +++ b/tests/auto/corelib/io/qdir/testdir/dir/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qdir.pro. ##################################################################### @@ -8,6 +11,6 @@ qt_internal_add_executable(qdir GUI DEFINES QT_DISABLE_DEPRECATED_BEFORE=0 - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui ) diff --git a/tests/auto/corelib/io/qdiriterator/CMakeLists.txt b/tests/auto/corelib/io/qdiriterator/CMakeLists.txt index feb742396d..eb77b780f2 100644 --- a/tests/auto/corelib/io/qdiriterator/CMakeLists.txt +++ b/tests/auto/corelib/io/qdiriterator/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qdiriterator.pro. ##################################################################### @@ -10,7 +13,7 @@ list(APPEND test_data "entrylist") qt_internal_add_test(tst_qdiriterator SOURCES tst_qdiriterator.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate TESTDATA ${test_data} ) diff --git a/tests/auto/corelib/io/qfile/CMakeLists.txt b/tests/auto/corelib/io/qfile/CMakeLists.txt index d9c148e9db..d328a57617 100644 --- a/tests/auto/corelib/io/qfile/CMakeLists.txt +++ b/tests/auto/corelib/io/qfile/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## tst_qfile Test: ##################################################################### @@ -16,7 +19,7 @@ list(APPEND test_data "resources/file1.ext1") qt_internal_add_test(tst_qfile SOURCES tst_qfile.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate Qt::TestPrivate TESTDATA ${test_data} @@ -59,7 +62,7 @@ qt_internal_add_resource(tst_qfile "copy-fallback" ##################################################################### qt_internal_extend_target(tst_qfile CONDITION TARGET Qt::Network - PUBLIC_LIBRARIES + LIBRARIES Qt::Network ) @@ -74,7 +77,7 @@ qt_internal_extend_target(tst_qfile CONDITION CONFIG___contains___builtin_testda ) qt_internal_extend_target(tst_qfile CONDITION WIN32 - PUBLIC_LIBRARIES + LIBRARIES ole32 uuid ) diff --git a/tests/auto/corelib/io/qfile/stdinprocess/CMakeLists.txt b/tests/auto/corelib/io/qfile/stdinprocess/CMakeLists.txt index e034e0502c..bda81da00c 100644 --- a/tests/auto/corelib/io/qfile/stdinprocess/CMakeLists.txt +++ b/tests/auto/corelib/io/qfile/stdinprocess/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from stdinprocess.pro. ##################################################################### diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index 0d7b2a4079..828a90e86e 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -1546,7 +1546,7 @@ static QString getWorkingDirectoryForLink(const QString &linkFileName) HRESULT hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void **)&psl); if (hres == CO_E_NOTINITIALIZED) { // COM was not initialized neededCoInit = true; - CoInitialize(NULL); + CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void **)&psl); } @@ -3797,8 +3797,8 @@ void tst_QFile::moveToTrash_data() void tst_QFile::moveToTrash() { -#ifdef Q_OS_ANDROID - QSKIP("Android doesn't implement a trash bin"); +#if defined(Q_OS_ANDROID) or defined(Q_OS_WEBOS) + QSKIP("This platform doesn't implement a trash bin"); #endif QFETCH(QString, source); QFETCH(bool, create); diff --git a/tests/auto/corelib/io/qfileinfo/CMakeLists.txt b/tests/auto/corelib/io/qfileinfo/CMakeLists.txt index 8b015d518c..6dfec3e946 100644 --- a/tests/auto/corelib/io/qfileinfo/CMakeLists.txt +++ b/tests/auto/corelib/io/qfileinfo/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qfileinfo.pro. ##################################################################### @@ -7,7 +10,7 @@ qt_internal_add_test(tst_qfileinfo SOURCES tst_qfileinfo.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate ) @@ -41,7 +44,7 @@ qt_internal_add_resource(tst_qfileinfo "testdata" ##################################################################### qt_internal_extend_target(tst_qfileinfo CONDITION WIN32 - PUBLIC_LIBRARIES + LIBRARIES advapi32 netapi32 ) diff --git a/tests/auto/corelib/io/qfileselector/CMakeLists.txt b/tests/auto/corelib/io/qfileselector/CMakeLists.txt index 1ceb91212a..7894b3317a 100644 --- a/tests/auto/corelib/io/qfileselector/CMakeLists.txt +++ b/tests/auto/corelib/io/qfileselector/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qfileselector.pro. ##################################################################### @@ -58,7 +61,7 @@ set(qfileselector_resource_files qt_internal_add_test(tst_qfileselectors SOURCES tst_qfileselector.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate TESTDATA ${qfileselector_resource_files} BUILTIN_TESTDATA diff --git a/tests/auto/corelib/io/qfilesystementry/CMakeLists.txt b/tests/auto/corelib/io/qfilesystementry/CMakeLists.txt index 84758836f2..984d695608 100644 --- a/tests/auto/corelib/io/qfilesystementry/CMakeLists.txt +++ b/tests/auto/corelib/io/qfilesystementry/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qfilesystementry.pro. ##################################################################### @@ -9,6 +12,6 @@ qt_internal_add_test(tst_qfilesystementry ../../../../../src/corelib/io/qfilesystementry.cpp ../../../../../src/corelib/io/qfilesystementry_p.h tst_qfilesystementry.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate ) diff --git a/tests/auto/corelib/io/qfilesystemmetadata/CMakeLists.txt b/tests/auto/corelib/io/qfilesystemmetadata/CMakeLists.txt index 9b1705f072..13db48f4e9 100644 --- a/tests/auto/corelib/io/qfilesystemmetadata/CMakeLists.txt +++ b/tests/auto/corelib/io/qfilesystemmetadata/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qfilesystemmetadata.pro. ##################################################################### @@ -7,6 +10,6 @@ qt_internal_add_test(tst_qfilesystemmetadata SOURCES tst_qfilesystemmetadata.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate ) diff --git a/tests/auto/corelib/io/qfilesystemwatcher/CMakeLists.txt b/tests/auto/corelib/io/qfilesystemwatcher/CMakeLists.txt index 7523122907..dc5dbf7be9 100644 --- a/tests/auto/corelib/io/qfilesystemwatcher/CMakeLists.txt +++ b/tests/auto/corelib/io/qfilesystemwatcher/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qfilesystemwatcher.pro. ##################################################################### diff --git a/tests/auto/corelib/io/qiodevice/CMakeLists.txt b/tests/auto/corelib/io/qiodevice/CMakeLists.txt index ce15e80be5..4f4fdf5dc0 100644 --- a/tests/auto/corelib/io/qiodevice/CMakeLists.txt +++ b/tests/auto/corelib/io/qiodevice/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qiodevice.pro. ##################################################################### @@ -10,7 +13,7 @@ list(APPEND test_data "tst_qiodevice.cpp") qt_internal_add_test(tst_qiodevice SOURCES tst_qiodevice.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Network TESTDATA ${test_data} QT_TEST_SERVER_LIST "apache2" "cyrus" diff --git a/tests/auto/corelib/io/qipaddress/CMakeLists.txt b/tests/auto/corelib/io/qipaddress/CMakeLists.txt index b4801c2ab2..7ed5c21641 100644 --- a/tests/auto/corelib/io/qipaddress/CMakeLists.txt +++ b/tests/auto/corelib/io/qipaddress/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qipaddress.pro. ##################################################################### @@ -7,6 +10,6 @@ qt_internal_add_test(tst_qipaddress SOURCES tst_qipaddress.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate ) diff --git a/tests/auto/corelib/io/qlockfile/CMakeLists.txt b/tests/auto/corelib/io/qlockfile/CMakeLists.txt index 456ee88bb0..b10b32b88a 100644 --- a/tests/auto/corelib/io/qlockfile/CMakeLists.txt +++ b/tests/auto/corelib/io/qlockfile/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## tst_qlockfile Test: ##################################################################### @@ -5,7 +8,7 @@ qt_internal_add_test(tst_qlockfile SOURCES tst_qlockfile.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Concurrent Qt::CorePrivate ) @@ -14,7 +17,7 @@ qt_internal_add_test(tst_qlockfile ##################################################################### qt_internal_extend_target(tst_qlockfile CONDITION WIN32 - PUBLIC_LIBRARIES + LIBRARIES advapi32 ) add_subdirectory(qlockfiletesthelper) diff --git a/tests/auto/corelib/io/qlockfile/qlockfiletesthelper/CMakeLists.txt b/tests/auto/corelib/io/qlockfile/qlockfiletesthelper/CMakeLists.txt index 8917f2aa34..f70aae94b3 100644 --- a/tests/auto/corelib/io/qlockfile/qlockfiletesthelper/CMakeLists.txt +++ b/tests/auto/corelib/io/qlockfile/qlockfiletesthelper/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qlockfile_test_helper.pro. ##################################################################### diff --git a/tests/auto/corelib/io/qloggingcategory/CMakeLists.txt b/tests/auto/corelib/io/qloggingcategory/CMakeLists.txt index 13ee586696..57ba3f2f9a 100644 --- a/tests/auto/corelib/io/qloggingcategory/CMakeLists.txt +++ b/tests/auto/corelib/io/qloggingcategory/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qloggingcategory.pro. ##################################################################### @@ -7,7 +10,7 @@ qt_internal_add_test(tst_qloggingcategory SOURCES tst_qloggingcategory.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate ) diff --git a/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp b/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp index a0a9bb940e..3ba6de20a9 100644 --- a/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp +++ b/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp @@ -181,7 +181,7 @@ private slots: void initTestCase() { qputenv("XDG_CONFIG_DIRS", "/does/not/exist"); - qputenv("QT_MESSAGE_PATTERN", QByteArray("%{category}: %{type},%{message}")); + qputenv("QT_MESSAGE_PATTERN", "%{category}: %{type},%{message}"); oldMessageHandler = qInstallMessageHandler(myCustomMessageHandler); // Create configuration _config = new Configuration(); diff --git a/tests/auto/corelib/io/qloggingregistry/CMakeLists.txt b/tests/auto/corelib/io/qloggingregistry/CMakeLists.txt index 80da400032..1e24e6d3eb 100644 --- a/tests/auto/corelib/io/qloggingregistry/CMakeLists.txt +++ b/tests/auto/corelib/io/qloggingregistry/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qloggingregistry.pro. ##################################################################### @@ -10,7 +13,7 @@ list(APPEND test_data "qtlogging.ini") qt_internal_add_test(tst_qloggingregistry SOURCES tst_qloggingregistry.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate TESTDATA ${test_data} ) diff --git a/tests/auto/corelib/io/qnodebug/CMakeLists.txt b/tests/auto/corelib/io/qnodebug/CMakeLists.txt index 5fd4a3738c..5e6707e3f9 100644 --- a/tests/auto/corelib/io/qnodebug/CMakeLists.txt +++ b/tests/auto/corelib/io/qnodebug/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qnodebug.pro. ##################################################################### diff --git a/tests/auto/corelib/io/qprocess-noapplication/CMakeLists.txt b/tests/auto/corelib/io/qprocess-noapplication/CMakeLists.txt index 0118d46ae8..ec5c98db50 100644 --- a/tests/auto/corelib/io/qprocess-noapplication/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess-noapplication/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qprocess-noapplication.pro. ##################################################################### diff --git a/tests/auto/corelib/io/qprocess/CMakeLists.txt b/tests/auto/corelib/io/qprocess/CMakeLists.txt index 2cd25cd07c..ff44c0b790 100644 --- a/tests/auto/corelib/io/qprocess/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + add_subdirectory(test) add_subdirectory(testProcessCrash) add_subdirectory(testProcessEcho) diff --git a/tests/auto/corelib/io/qprocess/fileWriterProcess/CMakeLists.txt b/tests/auto/corelib/io/qprocess/fileWriterProcess/CMakeLists.txt index ce4519ce99..e6c7f1c320 100644 --- a/tests/auto/corelib/io/qprocess/fileWriterProcess/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/fileWriterProcess/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from fileWriterProcess.pro. ##################################################################### diff --git a/tests/auto/corelib/io/qprocess/test/CMakeLists.txt b/tests/auto/corelib/io/qprocess/test/CMakeLists.txt index 9cd8fee6e8..d6b2220b01 100644 --- a/tests/auto/corelib/io/qprocess/test/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/test/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## tst_qprocess Test: ##################################################################### @@ -6,9 +9,10 @@ qt_internal_add_test(tst_qprocess OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../" SOURCES ../tst_qprocess.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate Qt::Network + Qt::TestPrivate ) ## Build assorted sub-programs called from the test: diff --git a/tests/auto/corelib/io/qprocess/testDetached/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testDetached/CMakeLists.txt index 368ca92f09..1fe52e5da4 100644 --- a/tests/auto/corelib/io/qprocess/testDetached/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testDetached/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from testDetached.pro. ##################################################################### diff --git a/tests/auto/corelib/io/qprocess/testExitCodes/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testExitCodes/CMakeLists.txt index c9baab6cfc..e2dd7319a5 100644 --- a/tests/auto/corelib/io/qprocess/testExitCodes/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testExitCodes/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## testExitCodes Binary: ##################################################################### diff --git a/tests/auto/corelib/io/qprocess/testForwarding/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testForwarding/CMakeLists.txt index adadbeca7a..9300622eea 100644 --- a/tests/auto/corelib/io/qprocess/testForwarding/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testForwarding/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## testForwarding Binary: ##################################################################### diff --git a/tests/auto/corelib/io/qprocess/testForwardingHelper/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testForwardingHelper/CMakeLists.txt index 80b0001a39..d4b8983dd5 100644 --- a/tests/auto/corelib/io/qprocess/testForwardingHelper/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testForwardingHelper/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## testForwardingHelper Binary: ##################################################################### diff --git a/tests/auto/corelib/io/qprocess/testGuiProcess/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testGuiProcess/CMakeLists.txt index e36a33bfa4..1e464dedb1 100644 --- a/tests/auto/corelib/io/qprocess/testGuiProcess/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testGuiProcess/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from testGuiProcess.pro. ##################################################################### @@ -8,7 +11,7 @@ qt_internal_add_executable(testGuiProcess OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" SOURCES main.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::Widgets ) diff --git a/tests/auto/corelib/io/qprocess/testProcessCrash/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessCrash/CMakeLists.txt index 230148ba22..b473e699cc 100644 --- a/tests/auto/corelib/io/qprocess/testProcessCrash/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testProcessCrash/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## testProcessCrash Binary: ##################################################################### diff --git a/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/CMakeLists.txt index 24e4e8f58c..907faa4092 100644 --- a/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## testProcessDeadWhileReading Binary: ##################################################################### diff --git a/tests/auto/corelib/io/qprocess/testProcessEOF/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessEOF/CMakeLists.txt index 6de59f67fe..a2ad584f9a 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEOF/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testProcessEOF/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## testProcessEOF Binary: ##################################################################### diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessEcho/CMakeLists.txt index 55b9537fe1..d742377241 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEcho/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testProcessEcho/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## testProcessEcho Binary: ##################################################################### diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho2/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessEcho2/CMakeLists.txt index b805dc2d85..0b18e8f0d5 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEcho2/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testProcessEcho2/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## testProcessEcho2 Binary: ##################################################################### diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho3/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessEcho3/CMakeLists.txt index dc1d262462..7a44bbdf63 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEcho3/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testProcessEcho3/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## testProcessEcho3 Binary: ##################################################################### diff --git a/tests/auto/corelib/io/qprocess/testProcessEchoGui/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessEchoGui/CMakeLists.txt index 3cc5e3641d..898eda78b8 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEchoGui/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testProcessEchoGui/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## testProcessEchoGui Binary: ##################################################################### diff --git a/tests/auto/corelib/io/qprocess/testProcessEnvironment/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessEnvironment/CMakeLists.txt index ec725b67ca..5969a87ad9 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEnvironment/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testProcessEnvironment/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## testProcessEnvironment Binary: ##################################################################### diff --git a/tests/auto/corelib/io/qprocess/testProcessHang/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessHang/CMakeLists.txt index 2c63be7ce9..6c66a6c938 100644 --- a/tests/auto/corelib/io/qprocess/testProcessHang/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testProcessHang/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## testProcessHang Binary: ##################################################################### diff --git a/tests/auto/corelib/io/qprocess/testProcessNormal/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessNormal/CMakeLists.txt index 10bbf3840d..2537bd20c9 100644 --- a/tests/auto/corelib/io/qprocess/testProcessNormal/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testProcessNormal/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## testProcessNormal Binary: ##################################################################### diff --git a/tests/auto/corelib/io/qprocess/testProcessOutput/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessOutput/CMakeLists.txt index cc621d62f6..1bedf070d4 100644 --- a/tests/auto/corelib/io/qprocess/testProcessOutput/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testProcessOutput/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## testProcessOutput Binary: ##################################################################### diff --git a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/CMakeLists.txt index 0d2fff73c8..30dc9348bf 100644 --- a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + add_executable(nospace main.cpp) add_executable(onespace main.cpp) diff --git a/tests/auto/corelib/io/qprocess/testSetNamedPipeHandleState/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testSetNamedPipeHandleState/CMakeLists.txt index a68d434f52..5775cd9820 100644 --- a/tests/auto/corelib/io/qprocess/testSetNamedPipeHandleState/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testSetNamedPipeHandleState/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## testSetNamedPipeHandleState Binary: ##################################################################### diff --git a/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/CMakeLists.txt index 97410c1b49..dc471b9374 100644 --- a/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from testSetWorkingDirectory.pro. ##################################################################### diff --git a/tests/auto/corelib/io/qprocess/testSoftExit/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testSoftExit/CMakeLists.txt index f6088e1032..a120c83963 100644 --- a/tests/auto/corelib/io/qprocess/testSoftExit/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testSoftExit/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## testSoftExit Binary: ##################################################################### @@ -7,7 +10,7 @@ add_executable(testSoftExit) qt_internal_extend_target(testSoftExit CONDITION WIN32 SOURCES main_win.cpp - PUBLIC_LIBRARIES + LIBRARIES user32 ) diff --git a/tests/auto/corelib/io/qprocess/testSpaceInName/CMakeLists.txt b/tests/auto/corelib/io/qprocess/testSpaceInName/CMakeLists.txt index 28107c9009..78f0a11cd1 100644 --- a/tests/auto/corelib/io/qprocess/testSpaceInName/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocess/testSpaceInName/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## testSpaceInName Binary: ##################################################################### diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp index 674e232eca..a2b3dfc154 100644 --- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp +++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp @@ -23,6 +23,8 @@ # include <private/qcore_unix_p.h> #endif +#include <QtTest/private/qemulationdetector_p.h> + #include <stdlib.h> typedef void (QProcess::*QProcessErrorSignal)(QProcess::ProcessError); @@ -1223,6 +1225,9 @@ void tst_QProcess::processInAThread() void tst_QProcess::processesInMultipleThreads() { + if (QTestPrivate::isRunningArmOnX86()) + QSKIP("Test is too slow to run on emulator"); + #if defined(Q_OS_QNX) QSKIP("QNX: Large amount of threads is unstable and do not finish in given time"); #endif diff --git a/tests/auto/corelib/io/qprocessenvironment/CMakeLists.txt b/tests/auto/corelib/io/qprocessenvironment/CMakeLists.txt index d612a32374..d483c66f1d 100644 --- a/tests/auto/corelib/io/qprocessenvironment/CMakeLists.txt +++ b/tests/auto/corelib/io/qprocessenvironment/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qprocessenvironment.pro. ##################################################################### diff --git a/tests/auto/corelib/io/qresourceengine/CMakeLists.txt b/tests/auto/corelib/io/qresourceengine/CMakeLists.txt index b6b3c588d5..5f950ace2d 100644 --- a/tests/auto/corelib/io/qresourceengine/CMakeLists.txt +++ b/tests/auto/corelib/io/qresourceengine/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## tst_qresourceengine Test: ##################################################################### diff --git a/tests/auto/corelib/io/qresourceengine/staticplugin/CMakeLists.txt b/tests/auto/corelib/io/qresourceengine/staticplugin/CMakeLists.txt index 5e2e374310..e461087562 100644 --- a/tests/auto/corelib/io/qresourceengine/staticplugin/CMakeLists.txt +++ b/tests/auto/corelib/io/qresourceengine/staticplugin/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## moctestplugin Generic Library: ##################################################################### diff --git a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp index 13508d953a..42018219a9 100644 --- a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp +++ b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp @@ -540,6 +540,15 @@ void tst_QResourceEngine::checkUnregisterResource() QVERIFY(QFile::exists(file_check)); QVERIFY(QResource::unregisterResource(rcc_file, root)); QVERIFY(!QFile::exists(file_check)); + { + // QTBUG-86088 + QVERIFY(QResource::registerResource(rcc_file, root)); + QFile file(file_check); + QVERIFY(file.open(QFile::ReadOnly)); + QVERIFY(!QResource::unregisterResource(rcc_file, root)); + file.close(); + QVERIFY(!QFile::exists(file_check)); + } QVERIFY(QResource::registerResource(rcc_file, root)); QVERIFY(QFile::exists(file_check)); QFileInfo fileInfo(file_check); diff --git a/tests/auto/corelib/io/qsavefile/CMakeLists.txt b/tests/auto/corelib/io/qsavefile/CMakeLists.txt index 0b41340279..bba2e89c36 100644 --- a/tests/auto/corelib/io/qsavefile/CMakeLists.txt +++ b/tests/auto/corelib/io/qsavefile/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qsavefile.pro. ##################################################################### diff --git a/tests/auto/corelib/io/qsettings/CMakeLists.txt b/tests/auto/corelib/io/qsettings/CMakeLists.txt index 2b60d1efff..8ccc77e315 100644 --- a/tests/auto/corelib/io/qsettings/CMakeLists.txt +++ b/tests/auto/corelib/io/qsettings/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qsettings.pro. ##################################################################### @@ -22,7 +25,7 @@ qt_internal_add_test(tst_qsettings tst_qsettings.cpp INCLUDE_DIRECTORIES ../../kernel/qmetatype - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate Qt::Gui TESTDATA ${qsettings_resource_files} @@ -34,11 +37,11 @@ qt_internal_add_test(tst_qsettings ##################################################################### qt_internal_extend_target(tst_qsettings CONDITION MSVC - PUBLIC_LIBRARIES + LIBRARIES advapi32 ) qt_internal_extend_target(tst_qsettings CONDITION APPLE - PUBLIC_LIBRARIES + LIBRARIES ${FWCoreFoundation} ) diff --git a/tests/auto/corelib/io/qstandardpaths/CMakeLists.txt b/tests/auto/corelib/io/qstandardpaths/CMakeLists.txt index f275b97efe..cb8e997c4d 100644 --- a/tests/auto/corelib/io/qstandardpaths/CMakeLists.txt +++ b/tests/auto/corelib/io/qstandardpaths/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qstandardpaths.pro. ##################################################################### diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp index 2c0500eec9..b2bb14180e 100644 --- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp +++ b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp @@ -64,10 +64,10 @@ private: qputenv("XDG_DATA_DIRS", QFile::encodeName(m_globalAppDir)); } void setDefaultLocations() { - qputenv("XDG_CONFIG_HOME", QByteArray()); - qputenv("XDG_CONFIG_DIRS", QByteArray()); - qputenv("XDG_DATA_HOME", QByteArray()); - qputenv("XDG_DATA_DIRS", QByteArray()); + qputenv("XDG_CONFIG_HOME", nullptr); + qputenv("XDG_CONFIG_DIRS", nullptr); + qputenv("XDG_DATA_HOME", nullptr); + qputenv("XDG_DATA_DIRS", nullptr); } #endif diff --git a/tests/auto/corelib/io/qstorageinfo/CMakeLists.txt b/tests/auto/corelib/io/qstorageinfo/CMakeLists.txt index be3a8c3afe..b118f5ef89 100644 --- a/tests/auto/corelib/io/qstorageinfo/CMakeLists.txt +++ b/tests/auto/corelib/io/qstorageinfo/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qstorageinfo.pro. ##################################################################### @@ -7,6 +10,6 @@ qt_internal_add_test(tst_qstorageinfo SOURCES tst_qstorageinfo.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate ) diff --git a/tests/auto/corelib/io/qtemporarydir/CMakeLists.txt b/tests/auto/corelib/io/qtemporarydir/CMakeLists.txt index fcfd409d5b..47dd1df5bf 100644 --- a/tests/auto/corelib/io/qtemporarydir/CMakeLists.txt +++ b/tests/auto/corelib/io/qtemporarydir/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qtemporarydir.pro. ##################################################################### @@ -7,7 +10,7 @@ qt_internal_add_test(tst_qtemporarydir SOURCES tst_qtemporarydir.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::TestPrivate ) diff --git a/tests/auto/corelib/io/qtemporaryfile/CMakeLists.txt b/tests/auto/corelib/io/qtemporaryfile/CMakeLists.txt index e7a1a65296..1ee39a3550 100644 --- a/tests/auto/corelib/io/qtemporaryfile/CMakeLists.txt +++ b/tests/auto/corelib/io/qtemporaryfile/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qtemporaryfile.pro. ##################################################################### @@ -10,7 +13,7 @@ list(APPEND test_data "tst_qtemporaryfile.cpp") qt_internal_add_test(tst_qtemporaryfile SOURCES tst_qtemporaryfile.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::TestPrivate TESTDATA ${test_data} ) diff --git a/tests/auto/corelib/io/qurl/CMakeLists.txt b/tests/auto/corelib/io/qurl/CMakeLists.txt index b5a2ec0331..8d63523c2e 100644 --- a/tests/auto/corelib/io/qurl/CMakeLists.txt +++ b/tests/auto/corelib/io/qurl/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qurl.pro. ##################################################################### @@ -7,7 +10,7 @@ qt_internal_add_test(tst_qurl SOURCES tst_qurl.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Concurrent Qt::TestPrivate ) diff --git a/tests/auto/corelib/io/qurlinternal/CMakeLists.txt b/tests/auto/corelib/io/qurlinternal/CMakeLists.txt index 492ac0a4d6..1723c189cc 100644 --- a/tests/auto/corelib/io/qurlinternal/CMakeLists.txt +++ b/tests/auto/corelib/io/qurlinternal/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qurlinternal.pro. if(NOT QT_FEATURE_private_tests) @@ -12,7 +15,7 @@ qt_internal_add_test(tst_qurlinternal SOURCES tst_qurlinternal.cpp utf8data.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate ) diff --git a/tests/auto/corelib/io/qurlquery/CMakeLists.txt b/tests/auto/corelib/io/qurlquery/CMakeLists.txt index b0484314d9..74899cdbbd 100644 --- a/tests/auto/corelib/io/qurlquery/CMakeLists.txt +++ b/tests/auto/corelib/io/qurlquery/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qurlquery.pro. ##################################################################### @@ -7,6 +10,6 @@ qt_internal_add_test(tst_qurlquery SOURCES tst_qurlquery.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate ) diff --git a/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp index c6985557d1..43a407da9d 100644 --- a/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp +++ b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp @@ -1,4 +1,5 @@ -// Copyright (C) 2016 Intel Corporation. +// Copyright (C) 2022 The Qt Company Ltd. +// Copyright (C) 2012 Intel Corporation. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include <QtCore/QUrlQuery> @@ -8,6 +9,8 @@ typedef QList<QPair<QString, QString> > QueryItems; Q_DECLARE_METATYPE(QueryItems) Q_DECLARE_METATYPE(QUrl::ComponentFormattingOptions) +using namespace Qt::StringLiterals; + class tst_QUrlQuery : public QObject { Q_OBJECT @@ -42,46 +45,32 @@ private Q_SLOTS: void old_hasQueryItem(); }; -static QString prettyElement(const QString &key, const QString &value) -{ - QString result; - if (key.isNull()) - result += "null -> "; - else - result += '"' + key + "\" -> "; - if (value.isNull()) - result += "null"; - else - result += '"' + value + '"'; - return result; -} - -static QString prettyPair(QList<QPair<QString, QString> >::const_iterator it) +static QString prettyPair(const QPair<QString, QString> &pair) { - return prettyElement(it->first, it->second); + const auto represent = [](const QString &s) { + return s.isNull() ? u"null"_s : u'"' + s + u'"'; + }; + return represent(pair.first) + " -> "_L1 + represent(pair.second); } -template <typename T> -static QByteArray prettyList(const T &items) +static QByteArray prettyList(const QueryItems &items) { - QString result = "("; - bool first = true; - typename T::const_iterator it = items.constBegin(); - for ( ; it != items.constEnd(); ++it) { - if (!first) - result += ", "; - first = false; - result += prettyPair(it); - } - result += QLatin1Char(')'); + if (items.isEmpty()) + return "()"; + auto it = items.constBegin(); + QString result = u'(' + prettyPair(*it); + for (++it; it != items.constEnd(); ++it) + result += ", "_L1 + prettyPair(*it); + result += u')'; return result.toLocal8Bit(); } -static bool compare(const QList<QPair<QString, QString> > &actual, const QueryItems &expected, +static bool compare(const QueryItems &actual, const QueryItems &expected, const char *actualStr, const char *expectedStr, const char *file, int line) { return QTest::compare_helper(actual == expected, "Compared values are not the same", - qstrdup(prettyList(actual)), qstrdup(prettyList(expected).data()), + [&actual] { return qstrdup(prettyList(actual).constData()); }, + [&expected] { return qstrdup(prettyList(expected).constData()); }, actualStr, expectedStr, file, line); } diff --git a/tests/auto/corelib/io/qurluts46/CMakeLists.txt b/tests/auto/corelib/io/qurluts46/CMakeLists.txt index 1e91fd17c8..f96060b9d6 100644 --- a/tests/auto/corelib/io/qurluts46/CMakeLists.txt +++ b/tests/auto/corelib/io/qurluts46/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## tst_qurluts46 Test: ##################################################################### diff --git a/tests/auto/corelib/itemmodels/CMakeLists.txt b/tests/auto/corelib/itemmodels/CMakeLists.txt index fcea1c843d..a59e260c47 100644 --- a/tests/auto/corelib/itemmodels/CMakeLists.txt +++ b/tests/auto/corelib/itemmodels/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from itemmodels.pro. add_subdirectory(qstringlistmodel) diff --git a/tests/auto/corelib/itemmodels/qabstractitemmodel/CMakeLists.txt b/tests/auto/corelib/itemmodels/qabstractitemmodel/CMakeLists.txt index 2f91f7d41a..43776d0166 100644 --- a/tests/auto/corelib/itemmodels/qabstractitemmodel/CMakeLists.txt +++ b/tests/auto/corelib/itemmodels/qabstractitemmodel/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qabstractitemmodel.pro. ##################################################################### @@ -12,6 +15,6 @@ qt_internal_add_test(tst_qabstractitemmodel QT_DISABLE_DEPRECATED_BEFORE=0 INCLUDE_DIRECTORIES ../../../other/qabstractitemmodelutils - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui ) diff --git a/tests/auto/corelib/itemmodels/qabstractproxymodel/CMakeLists.txt b/tests/auto/corelib/itemmodels/qabstractproxymodel/CMakeLists.txt index 6c782326cb..fdb3c80aa9 100644 --- a/tests/auto/corelib/itemmodels/qabstractproxymodel/CMakeLists.txt +++ b/tests/auto/corelib/itemmodels/qabstractproxymodel/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qabstractproxymodel.pro. ##################################################################### diff --git a/tests/auto/corelib/itemmodels/qconcatenatetablesproxymodel/CMakeLists.txt b/tests/auto/corelib/itemmodels/qconcatenatetablesproxymodel/CMakeLists.txt index 40dd512489..cb2832e683 100644 --- a/tests/auto/corelib/itemmodels/qconcatenatetablesproxymodel/CMakeLists.txt +++ b/tests/auto/corelib/itemmodels/qconcatenatetablesproxymodel/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qconcatenatetablesproxymodel.pro. ##################################################################### @@ -7,6 +10,6 @@ qt_internal_add_test(tst_qconcatenatetablesproxymodel SOURCES tst_qconcatenatetablesproxymodel.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui ) diff --git a/tests/auto/corelib/itemmodels/qidentityproxymodel/CMakeLists.txt b/tests/auto/corelib/itemmodels/qidentityproxymodel/CMakeLists.txt index fb2ae55215..f0e2b83ba1 100644 --- a/tests/auto/corelib/itemmodels/qidentityproxymodel/CMakeLists.txt +++ b/tests/auto/corelib/itemmodels/qidentityproxymodel/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qidentityproxymodel.pro. ##################################################################### @@ -10,6 +13,6 @@ qt_internal_add_test(tst_qidentityproxymodel tst_qidentityproxymodel.cpp INCLUDE_DIRECTORIES ../../../other/qabstractitemmodelutils - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui ) diff --git a/tests/auto/corelib/itemmodels/qitemmodel/CMakeLists.txt b/tests/auto/corelib/itemmodels/qitemmodel/CMakeLists.txt index 7dda1a3964..039aff8147 100644 --- a/tests/auto/corelib/itemmodels/qitemmodel/CMakeLists.txt +++ b/tests/auto/corelib/itemmodels/qitemmodel/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qitemmodel.pro. ##################################################################### @@ -7,7 +10,7 @@ qt_internal_add_test(tst_qitemmodel SOURCES tst_qitemmodel.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::Sql Qt::Widgets diff --git a/tests/auto/corelib/itemmodels/qitemselectionmodel/CMakeLists.txt b/tests/auto/corelib/itemmodels/qitemselectionmodel/CMakeLists.txt index 8eadf67b66..ca29c92f96 100644 --- a/tests/auto/corelib/itemmodels/qitemselectionmodel/CMakeLists.txt +++ b/tests/auto/corelib/itemmodels/qitemselectionmodel/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qitemselectionmodel.pro. ##################################################################### diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/CMakeLists.txt b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/CMakeLists.txt index 25c8553088..d38477af9b 100644 --- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/CMakeLists.txt +++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## tst_qsortfilterproxymodel Test: ##################################################################### diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_recursive/CMakeLists.txt b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_recursive/CMakeLists.txt index 678a814224..6e93ffb0c5 100644 --- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_recursive/CMakeLists.txt +++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_recursive/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qsortfilterproxymodel_recursive.pro. ##################################################################### @@ -9,6 +12,6 @@ qt_internal_add_test(tst_qsfpm_recursive tst_qsortfilterproxymodel_recursive.cpp DEFINES QT_DISABLE_DEPRECATED_BEFORE=0 - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui ) diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regularexpression/CMakeLists.txt b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regularexpression/CMakeLists.txt index 1f41f26a11..bd91b15b39 100644 --- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regularexpression/CMakeLists.txt +++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regularexpression/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## tst_qsortfilterproxymodel_regularexpression Test: ##################################################################### diff --git a/tests/auto/corelib/itemmodels/qstringlistmodel/CMakeLists.txt b/tests/auto/corelib/itemmodels/qstringlistmodel/CMakeLists.txt index c6123bb1e3..43bdce0dc5 100644 --- a/tests/auto/corelib/itemmodels/qstringlistmodel/CMakeLists.txt +++ b/tests/auto/corelib/itemmodels/qstringlistmodel/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qstringlistmodel.pro. ##################################################################### diff --git a/tests/auto/corelib/itemmodels/qtransposeproxymodel/CMakeLists.txt b/tests/auto/corelib/itemmodels/qtransposeproxymodel/CMakeLists.txt index 7cc675d7fd..d1653b21ef 100644 --- a/tests/auto/corelib/itemmodels/qtransposeproxymodel/CMakeLists.txt +++ b/tests/auto/corelib/itemmodels/qtransposeproxymodel/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qtransposeproxymodel.pro. ##################################################################### @@ -7,6 +10,6 @@ qt_internal_add_test(tst_qtransposeproxymodel SOURCES tst_qtransposeproxymodel.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui ) diff --git a/tests/auto/corelib/kernel/CMakeLists.txt b/tests/auto/corelib/kernel/CMakeLists.txt index 3083652945..67b41a3f91 100644 --- a/tests/auto/corelib/kernel/CMakeLists.txt +++ b/tests/auto/corelib/kernel/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from kernel.pro. add_subdirectory(qapplicationstatic) diff --git a/tests/auto/corelib/kernel/qapplicationstatic/CMakeLists.txt b/tests/auto/corelib/kernel/qapplicationstatic/CMakeLists.txt index 0890113c55..b9630cc57a 100644 --- a/tests/auto/corelib/kernel/qapplicationstatic/CMakeLists.txt +++ b/tests/auto/corelib/kernel/qapplicationstatic/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## tst_qapplicationstatic Test: ##################################################################### diff --git a/tests/auto/corelib/kernel/qcoreapplication/CMakeLists.txt b/tests/auto/corelib/kernel/qcoreapplication/CMakeLists.txt index 92d4b03d26..baca197190 100644 --- a/tests/auto/corelib/kernel/qcoreapplication/CMakeLists.txt +++ b/tests/auto/corelib/kernel/qcoreapplication/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qcoreapplication.pro. if(NOT QT_FEATURE_private_tests) @@ -20,7 +23,7 @@ qt_internal_add_test(tst_qcoreapplication VERSION ${target_version} # special case SOURCES tst_qcoreapplication.cpp tst_qcoreapplication.h - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate ) diff --git a/tests/auto/corelib/kernel/qdeadlinetimer/CMakeLists.txt b/tests/auto/corelib/kernel/qdeadlinetimer/CMakeLists.txt index 8c8721abf5..315730b5e0 100644 --- a/tests/auto/corelib/kernel/qdeadlinetimer/CMakeLists.txt +++ b/tests/auto/corelib/kernel/qdeadlinetimer/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qdeadlinetimer.pro. ##################################################################### diff --git a/tests/auto/corelib/kernel/qelapsedtimer/CMakeLists.txt b/tests/auto/corelib/kernel/qelapsedtimer/CMakeLists.txt index 1592303ae3..c12a09fc44 100644 --- a/tests/auto/corelib/kernel/qelapsedtimer/CMakeLists.txt +++ b/tests/auto/corelib/kernel/qelapsedtimer/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qelapsedtimer.pro. ##################################################################### diff --git a/tests/auto/corelib/kernel/qelapsedtimer/tst_qelapsedtimer.cpp b/tests/auto/corelib/kernel/qelapsedtimer/tst_qelapsedtimer.cpp index 652a62f640..f2f42bef4b 100644 --- a/tests/auto/corelib/kernel/qelapsedtimer/tst_qelapsedtimer.cpp +++ b/tests/auto/corelib/kernel/qelapsedtimer/tst_qelapsedtimer.cpp @@ -9,11 +9,13 @@ static const int minResolution = 100; // the minimum resolution for the tests +QT_BEGIN_NAMESPACE QDebug operator<<(QDebug s, const QElapsedTimer &t) { s.nospace() << "(" << t.msecsSinceReference() << ")"; return s.space(); } +QT_END_NAMESPACE class tst_QElapsedTimer : public QObject { diff --git a/tests/auto/corelib/kernel/qeventdispatcher/CMakeLists.txt b/tests/auto/corelib/kernel/qeventdispatcher/CMakeLists.txt index 409764a2c7..d67080686f 100644 --- a/tests/auto/corelib/kernel/qeventdispatcher/CMakeLists.txt +++ b/tests/auto/corelib/kernel/qeventdispatcher/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qeventdispatcher.pro. ##################################################################### diff --git a/tests/auto/corelib/kernel/qeventloop/CMakeLists.txt b/tests/auto/corelib/kernel/qeventloop/CMakeLists.txt index d3b817598e..a931b4fae6 100644 --- a/tests/auto/corelib/kernel/qeventloop/CMakeLists.txt +++ b/tests/auto/corelib/kernel/qeventloop/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qeventloop.pro. ##################################################################### @@ -7,7 +10,7 @@ qt_internal_add_test(tst_qeventloop SOURCES tst_qeventloop.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate Qt::Network ) @@ -16,7 +19,7 @@ qt_internal_add_test(tst_qeventloop ##################################################################### qt_internal_extend_target(tst_qeventloop CONDITION WIN32 - PUBLIC_LIBRARIES + LIBRARIES user32 ) diff --git a/tests/auto/corelib/kernel/qjnienvironment/CMakeLists.txt b/tests/auto/corelib/kernel/qjnienvironment/CMakeLists.txt index 25e7e51ba6..40b76b2f29 100644 --- a/tests/auto/corelib/kernel/qjnienvironment/CMakeLists.txt +++ b/tests/auto/corelib/kernel/qjnienvironment/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## tst_qjnienvironment Test: ##################################################################### diff --git a/tests/auto/corelib/kernel/qjnienvironment/testdata/src/org/qtproject/qt/android/testdata/QtJniEnvironmentTestClass.java b/tests/auto/corelib/kernel/qjnienvironment/testdata/src/org/qtproject/qt/android/testdata/QtJniEnvironmentTestClass.java index 0fc70f2567..984307d57d 100644 --- a/tests/auto/corelib/kernel/qjnienvironment/testdata/src/org/qtproject/qt/android/testdata/QtJniEnvironmentTestClass.java +++ b/tests/auto/corelib/kernel/qjnienvironment/testdata/src/org/qtproject/qt/android/testdata/QtJniEnvironmentTestClass.java @@ -6,6 +6,10 @@ package org.qtproject.qt.android.testdatapackage; public class QtJniEnvironmentTestClass { private static native void callbackFromJava(String message); + private static native void namedCallbackFromJava(String message); + private static native void memberCallbackFromJava(String message); + private static native void namedMemberCallbackFromJava(String message); + private static native void namespaceCallbackFromJava(String message); private static native void intCallbackFromJava(int value); public final int INT_FIELD = 123; @@ -18,6 +22,26 @@ public class QtJniEnvironmentTestClass callbackFromJava("From Java: " + message); } + public static void namedAppendJavaToString(String message) + { + namedCallbackFromJava("From Java (named): " + message); + } + + public static void memberAppendJavaToString(String message) + { + memberCallbackFromJava("From Java (member): " + message); + } + + public static void namedMemberAppendJavaToString(String message) + { + namedMemberCallbackFromJava("From Java (named member): " + message); + } + + public static void namespaceAppendJavaToString(String message) + { + namespaceCallbackFromJava("From Java (namespace): " + message); + } + public static void convertToInt(String message) { intCallbackFromJava(Integer.parseInt(message)); diff --git a/tests/auto/corelib/kernel/qjnienvironment/tst_qjnienvironment.cpp b/tests/auto/corelib/kernel/qjnienvironment/tst_qjnienvironment.cpp index f699d6816a..da72b6d32b 100644 --- a/tests/auto/corelib/kernel/qjnienvironment/tst_qjnienvironment.cpp +++ b/tests/auto/corelib/kernel/qjnienvironment/tst_qjnienvironment.cpp @@ -65,6 +65,7 @@ void tst_QJniEnvironment::jniEnv() // try to find an existing class with QJniEnvironment QJniEnvironment env; QVERIFY(env.findClass("java/lang/Object")); + QVERIFY(env.findClass<jstring>()); // try to find a nonexistent class QVERIFY(!env.findClass("this/doesnt/Exist")); @@ -98,14 +99,49 @@ static void callbackFromJava(JNIEnv *env, jobject /*thiz*/, jstring value) Q_UNUSED(env) registerNativesString = QJniObject(value).toString(); } -Q_JNI_DECLARE_NATIVE_METHOD(callbackFromJava); +Q_DECLARE_JNI_NATIVE_METHOD(callbackFromJava); + +static void tediouslyLongNamed_callbackFromJava(JNIEnv *env, jobject /*thiz*/, jstring value) +{ + Q_UNUSED(env) + registerNativesString = QJniObject(value).toString(); +} +Q_DECLARE_JNI_NATIVE_METHOD(tediouslyLongNamed_callbackFromJava, namedCallbackFromJava) static void callbackFromJavaNoCtor(JNIEnv *env, jobject /*thiz*/, jstring value) { Q_UNUSED(env) registerNativesString = QJniObject(value).toString(); } -Q_JNI_DECLARE_NATIVE_METHOD(callbackFromJavaNoCtor); +Q_DECLARE_JNI_NATIVE_METHOD(callbackFromJavaNoCtor); + +class CallbackClass { +public: + static void memberCallbackFromJava(JNIEnv *env, jobject /*thiz*/, jstring value) + { + Q_UNUSED(env) + registerNativesString = QJniObject(value).toString(); + } + Q_DECLARE_JNI_NATIVE_METHOD_IN_CURRENT_SCOPE(memberCallbackFromJava) + + static void tediouslyLongNamed_memberCallbackFromJava(JNIEnv *env, jobject /*thiz*/, + jstring value) + { + Q_UNUSED(env) + registerNativesString = QJniObject(value).toString(); + } + Q_DECLARE_JNI_NATIVE_METHOD_IN_CURRENT_SCOPE(tediouslyLongNamed_memberCallbackFromJava, + namedMemberCallbackFromJava) +}; + +namespace CallbackNamespace { + static void namespaceCallbackFromJava(JNIEnv *env, jobject /*thiz*/, jstring value) + { + Q_UNUSED(env) + registerNativesString = QJniObject(value).toString(); + } + Q_DECLARE_JNI_NATIVE_METHOD_IN_CURRENT_SCOPE(namespaceCallbackFromJava) +} void tst_QJniEnvironment::registerNativeMethods() { @@ -125,6 +161,63 @@ void tst_QJniEnvironment::registerNativeMethods() QVERIFY(registerNativesString == QStringLiteral("From Java: Qt")); } + // Named native function + { + QVERIFY(env.registerNativeMethods(javaTestClass, { + Q_JNI_NATIVE_METHOD(tediouslyLongNamed_callbackFromJava) + })); + + QJniObject::callStaticMethod<void>(javaTestClass, + "namedAppendJavaToString", + "(Ljava/lang/String;)V", + QtString.object<jstring>()); + QTest::qWait(200); + QVERIFY(registerNativesString == QStringLiteral("From Java (named): Qt")); + } + + // Static class member as callback + { + QVERIFY(env.registerNativeMethods(javaTestClass, { + Q_JNI_NATIVE_SCOPED_METHOD(memberCallbackFromJava, CallbackClass) + })); + + QJniObject::callStaticMethod<void>(javaTestClass, + "memberAppendJavaToString", + "(Ljava/lang/String;)V", + QtString.object<jstring>()); + QTest::qWait(200); + QVERIFY(registerNativesString == QStringLiteral("From Java (member): Qt")); + } + + // Static named class member as callback + { + QVERIFY(env.registerNativeMethods(javaTestClass, { + Q_JNI_NATIVE_SCOPED_METHOD(tediouslyLongNamed_memberCallbackFromJava, + CallbackClass) + })); + + QJniObject::callStaticMethod<void>(javaTestClass, + "namedMemberAppendJavaToString", + "(Ljava/lang/String;)V", + QtString.object<jstring>()); + QTest::qWait(200); + QVERIFY(registerNativesString == QStringLiteral("From Java (named member): Qt")); + } + + // Function generally just in namespace as callback + { + QVERIFY(env.registerNativeMethods(javaTestClass, { + Q_JNI_NATIVE_SCOPED_METHOD(namespaceCallbackFromJava, CallbackNamespace) + })); + + QJniObject::callStaticMethod<void>(javaTestClass, + "namespaceAppendJavaToString", + "(Ljava/lang/String;)V", + QtString.object<jstring>()); + QTest::qWait(200); + QVERIFY(registerNativesString == QStringLiteral("From Java (namespace): Qt")); + } + // No default constructor in class { QVERIFY(env.registerNativeMethods(javaTestClassNoCtor, { @@ -145,7 +238,7 @@ static void intCallbackFromJava(JNIEnv *env, jobject /*thiz*/, jint value) Q_UNUSED(env) registerNativeInteger = static_cast<int>(value); } -Q_JNI_DECLARE_NATIVE_METHOD(intCallbackFromJava); +Q_DECLARE_JNI_NATIVE_METHOD(intCallbackFromJava); void tst_QJniEnvironment::registerNativeMethodsByJclass() { diff --git a/tests/auto/corelib/kernel/qjniobject/CMakeLists.txt b/tests/auto/corelib/kernel/qjniobject/CMakeLists.txt index b0f5d0b640..b54cf4b4cc 100644 --- a/tests/auto/corelib/kernel/qjniobject/CMakeLists.txt +++ b/tests/auto/corelib/kernel/qjniobject/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + ##################################################################### ## tst_qjniobject Test: ##################################################################### diff --git a/tests/auto/corelib/kernel/qjniobject/tst_qjniobject.cpp b/tests/auto/corelib/kernel/qjniobject/tst_qjniobject.cpp index 8faa9b6fbb..7ea6b1e121 100644 --- a/tests/auto/corelib/kernel/qjniobject/tst_qjniobject.cpp +++ b/tests/auto/corelib/kernel/qjniobject/tst_qjniobject.cpp @@ -9,6 +9,7 @@ #include <QtTest> static const char testClassName[] = "org/qtproject/qt/android/testdatapackage/QtJniObjectTestClass"; +Q_DECLARE_JNI_CLASS(QtJniObjectTestClass, testClassName) static const jbyte A_BYTE_VALUE = 127; static const jshort A_SHORT_VALUE = 32767; @@ -135,6 +136,11 @@ void tst_QJniObject::ctor() } { + QJniObject object = QJniObject::construct<jstring>(); + QVERIFY(object.isValid()); + } + + { QJniObject string = QJniObject::fromString(QLatin1String("Hello, Java")); QJniObject object("java/lang/String", "(Ljava/lang/String;)V", string.object<jstring>()); QVERIFY(object.isValid()); @@ -143,7 +149,7 @@ void tst_QJniObject::ctor() { QJniObject string = QJniObject::fromString(QLatin1String("Hello, Java")); - QJniObject object("java/lang/String", string.object<jstring>()); + QJniObject object = QJniObject::construct<jstring>(string.object<jstring>()); QVERIFY(object.isValid()); QCOMPARE(string.toString(), object.toString()); } @@ -1030,6 +1036,12 @@ void setStaticField(const char *fieldName, T testValue) T res = QJniObject::getStaticField<T>(testClassName, fieldName); QCOMPARE(res, testValue); + + // use template overload to reset to default + T defaultValue = {}; + QJniObject::setStaticField<QtJniTypes::QtJniObjectTestClass, T>(fieldName, defaultValue); + res = QJniObject::getStaticField<QtJniTypes::QtJniObjectTestClass, T>(fieldName); + QCOMPARE(res, defaultValue); } void tst_QJniObject::setStaticIntField() diff --git a/tests/auto/corelib/kernel/qjnitypes/CMakeLists.txt b/tests/auto/corelib/kernel/qjnitypes/CMakeLists.txt index 8184e91a11..6aa5534b31 100644 --- a/tests/auto/corelib/kernel/qjnitypes/CMakeLists.txt +++ b/tests/auto/corelib/kernel/qjnitypes/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + qt_internal_add_test(tst_qjnitypes SOURCES tst_qjnitypes.cpp diff --git a/tests/auto/corelib/kernel/qjnitypes/tst_qjnitypes.cpp b/tests/auto/corelib/kernel/qjnitypes/tst_qjnitypes.cpp index c4abfe399a..395028b8cb 100644 --- a/tests/auto/corelib/kernel/qjnitypes/tst_qjnitypes.cpp +++ b/tests/auto/corelib/kernel/qjnitypes/tst_qjnitypes.cpp @@ -14,6 +14,7 @@ public: private slots: void initTestCase(); + void nativeMethod(); }; struct QtJavaWrapper {}; @@ -45,6 +46,11 @@ static_assert(QtJniTypes::typeSignature<QtJniTypes::JavaType>() == "Lorg/qtproje Q_DECLARE_JNI_TYPE(ArrayType, "[Lorg/qtproject/qt/ArrayType;") static_assert(QtJniTypes::typeSignature<QtJniTypes::ArrayType>() == "[Lorg/qtproject/qt/ArrayType;"); +static_assert(QtJniTypes::className<jstring>() == "java/lang/String"); + +Q_DECLARE_JNI_CLASS(QtTextToSpeech, "org/qtproject/qt/android/speech/QtTextToSpeech") +static_assert(QtJniTypes::className<QtJniTypes::QtTextToSpeech>() == "org/qtproject/qt/android/speech/QtTextToSpeech"); + static_assert(QtJniTypes::fieldSignature<jint>() == "I"); static_assert(QtJniTypes::fieldSignature<jint>() != "X"); static_assert(QtJniTypes::fieldSignature<jint>() != "Ljava/lang/Object;"); @@ -97,6 +103,22 @@ void tst_QJniTypes::initTestCase() } +static bool nativeFunction(JNIEnv *, jclass, int, jstring, long) +{ + return true; +} +Q_DECLARE_JNI_NATIVE_METHOD(nativeFunction) + +static_assert(QtJniTypes::nativeMethodSignature(nativeFunction) == "(ILjava/lang/String;J)Z"); + +void tst_QJniTypes::nativeMethod() +{ + const auto method = Q_JNI_NATIVE_METHOD(nativeFunction); + QVERIFY(method.fnPtr == nativeFunction); + QCOMPARE(method.name, "nativeFunction"); + QCOMPARE(method.signature, "(ILjava/lang/String;J)Z"); +} + QTEST_MAIN(tst_QJniTypes) #include "tst_qjnitypes.moc" diff --git a/tests/auto/corelib/kernel/qmath/CMakeLists.txt b/tests/auto/corelib/kernel/qmath/CMakeLists.txt index 7a6d4bd688..8a917bfd27 100644 --- a/tests/auto/corelib/kernel/qmath/CMakeLists.txt +++ b/tests/auto/corelib/kernel/qmath/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qmath.pro. ##################################################################### diff --git a/tests/auto/corelib/kernel/qmetacontainer/CMakeLists.txt b/tests/auto/corelib/kernel/qmetacontainer/CMakeLists.txt index 79bb6a9324..33a7c4efb7 100644 --- a/tests/auto/corelib/kernel/qmetacontainer/CMakeLists.txt +++ b/tests/auto/corelib/kernel/qmetacontainer/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qmetacontainer.pro. ##################################################################### @@ -7,6 +10,6 @@ qt_internal_add_test(tst_qmetacontainer SOURCES tst_qmetacontainer.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate ) diff --git a/tests/auto/corelib/kernel/qmetaenum/CMakeLists.txt b/tests/auto/corelib/kernel/qmetaenum/CMakeLists.txt index daee210588..4a0e5e864f 100644 --- a/tests/auto/corelib/kernel/qmetaenum/CMakeLists.txt +++ b/tests/auto/corelib/kernel/qmetaenum/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qmetaenum.pro. ##################################################################### diff --git a/tests/auto/corelib/kernel/qmetamethod/CMakeLists.txt b/tests/auto/corelib/kernel/qmetamethod/CMakeLists.txt index 6ab3f143ac..48910164e5 100644 --- a/tests/auto/corelib/kernel/qmetamethod/CMakeLists.txt +++ b/tests/auto/corelib/kernel/qmetamethod/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + # Generated from qmetamethod.pro. ##################################################################### diff --git a/tests/auto/corelib/kernel/qmetamethod/tst_qmetamethod.cpp b/tests/auto/corelib/kernel/qmetamethod/tst_qmetamethod.cpp index 2b8ef8358d..4cc15159e7 100644 --- a/tests/auto/corelib/kernel/qmetamethod/tst_qmetamethod.cpp +++ b/tests/auto/corelib/kernel/qmetamethod/tst_qmetamethod.cpp @@ -32,6 +32,9 @@ private slots: void parameterTypeName(); void isConst(); + + void methodIndexes_data(); + void methodIndexes(); }; struct CustomType { }; @@ -862,6 +865,42 @@ void tst_QMetaMethod::isConst() } } +void tst_QMetaMethod::methodIndexes_data() +{ + QTest::addColumn<QByteArray>("signature"); + QTest::addColumn<QMetaMethod::MethodType>("methodType"); + + QTest::newRow("constructor1") << QByteArray("MethodTestObject()") << QMetaMethod::Constructor; + QTest::newRow("constructor5") << QByteArray("MethodTestObject(CustomUnregisteredType)") + << QMetaMethod::Constructor; + QTest::newRow("method0") << QByteArray("voidInvokable()") << QMetaMethod::Method; + QTest::newRow("method6") << QByteArray("boolInvokable()") << QMetaMethod::Method; +} + +void tst_QMetaMethod::methodIndexes() +{ + QFETCH(QByteArray, signature); + QFETCH(QMetaMethod::MethodType, methodType); + + const bool isConstructor = methodType == QMetaMethod::Constructor; + + // roundtrip: index = QMetaObject::indexOfConstructor/Method() + // <-> method = QMetaObject::constructor/method() + // <-> indexThatShouldBeEqualToAboveIndex = QMetaMethod::methodIndex() + + const QMetaObject *mo = &MethodTestObject::staticMetaObject; + const int index = + isConstructor ? mo->indexOfConstructor(signature) : mo->indexOfMethod(signature); + QVERIFY(index != -1); + + QMetaMethod methodFromMetaObject = + mo->method(index); // should work on all methods (constructors, signals, ...) + const int absoluteMethodIndex = + methodFromMetaObject + .methodIndex(); // should work on all methods (constructors, signals, ...) + + QCOMPARE(absoluteMethodIndex, index); +} QTEST_MAIN(tst_QMetaMethod) #include "tst_qmetamethod.moc" diff --git a/tests/auto/corelib/kernel/qmetaobject/CMakeLists.txt b/tests/auto/corelib/kernel/qmetaobject/CMakeLists.txt index d0736f418d..e4dcf56e78 100644 --- a/tests/auto/corelib/kernel/qmetaobject/CMakeLists.txt +++ b/tests/auto/corelib/kernel/qmetaobject/CMakeLists.txt @@ -1,3 +1,12 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +set(tst_qmetaobject_SOURCES + tst_qmetaobject.cpp + forwarddeclared.h + forwarddeclared.cpp +) + # Generated from qmetaobject.pro. ##################################################################### @@ -6,10 +15,8 @@ qt_internal_add_test(tst_qmetaobject SOURCES - tst_qmetaobject.cpp - PUBLIC_LIBRARIES + ${tst_qmetaobject_SOURCES} + LIBRARIES Qt::CorePrivate ) -## Scopes: -##################################################################### diff --git a/tests/auto/corelib/kernel/qmetaobject/forwarddeclared.cpp b/tests/auto/corelib/kernel/qmetaobject/forwarddeclared.cpp new file mode 100644 index 0000000000..8772bc4e61 --- /dev/null +++ b/tests/auto/corelib/kernel/qmetaobject/forwarddeclared.cpp @@ -0,0 +1,17 @@ +// Copyright (C) 2022 Intel Corporation. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#include "forwarddeclared.h" + +struct MyForwardDeclaredType { }; +static MyForwardDeclaredType t; + +const MyForwardDeclaredType &getForwardDeclaredType() noexcept +{ + return t; +} + +MyForwardDeclaredType *getForwardDeclaredPointer() noexcept +{ + return &t; +} diff --git a/tests/auto/corelib/kernel/qmetaobject/forwarddeclared.h b/tests/auto/corelib/kernel/qmetaobject/forwarddeclared.h new file mode 100644 index 0000000000..89fb0839c1 --- /dev/null +++ b/tests/auto/corelib/kernel/qmetaobject/forwarddeclared.h @@ -0,0 +1,12 @@ +// Copyright (C) 2022 Intel Corporation. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef FORWARDDECLARED_H +#define FORWARDDECLARED_H + +struct MyForwardDeclaredType; // and ONLY forward-declared + +const MyForwardDeclaredType &getForwardDeclaredType() noexcept; +MyForwardDeclaredType *getForwardDeclaredPointer() noexcept; + +#endif // FORWARDDECLARED_H diff --git a/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp b/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp index 3b2066ba5d..01f9617be1 100644 --- a/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp +++ b/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp @@ -12,6 +12,8 @@ Q_DECLARE_METATYPE(const QMetaObject *) +#include "forwarddeclared.h" + struct MyStruct { int i; @@ -215,8 +217,7 @@ namespace MyNamespace { int m_value2 = 0; int m_value3 = 0; }; -} - +} // namespace MyNamespace class tst_QMetaObject : public QObject { @@ -265,6 +266,8 @@ public: QList<QVariant> value4; QVariantList value5; + tst_QMetaObject(); + private slots: void connectSlotsByName(); void invokeMetaMember(); @@ -401,6 +404,11 @@ private slots: #define FUNCTION(x) "QMetaObject::" x ": " +tst_QMetaObject::tst_QMetaObject() +{ + qRegisterMetaType<qlonglong *>(); +} + void tst_QMetaObject::connectSlotsByName() { CTestObject obj; @@ -435,8 +443,6 @@ void tst_QMetaObject::connectSlotsByName() QCOMPARE(obj2.invokeCount2, 1); } -struct MyUnregisteredType { }; - static int countedStructObjectsCount = 0; struct CountedStruct { @@ -459,6 +465,8 @@ public: QtTestObject(); QtTestObject(const QString &s) : slotResult(s) {} Q_INVOKABLE QtTestObject(QObject *parent); + Q_INVOKABLE QtTestObject(QObject *parent, int, int); + Q_INVOKABLE QtTestObject(QObject *parent, int); public slots: void sl0(); @@ -479,17 +487,22 @@ public slots: const char *sl12(); QList<QString> sl13(QList<QString> l1); qint64 sl14(); - void testSender(); + qlonglong *sl15(qlonglong *); + MyForwardDeclaredType *sl16(MyForwardDeclaredType *); - void testReference(QString &str); + void overloadedSlot(); + void overloadedSlot(int, int); + void overloadedSlot(int); + void testSender(); + void testReference(QString &str); void testLongLong(qint64 ll1, quint64 ll2); void moveToThread(QThread *t) { QObject::moveToThread(t); } - void slotWithUnregisteredParameterType(MyUnregisteredType); - void slotWithOneUnregisteredParameterType(QString a1, MyUnregisteredType a2); + void slotWithUnregisteredParameterType(const MyForwardDeclaredType &); + void slotWithOneUnregisteredParameterType(QString a1, const MyForwardDeclaredType &a2); CountedStruct throwingSlot(const CountedStruct &, CountedStruct s2) { #ifndef QT_NO_EXCEPTIONS @@ -540,6 +553,14 @@ QtTestObject::QtTestObject(QObject *parent) { } +QtTestObject::QtTestObject(QObject *parent, int, int) + : QObject(parent) +{ slotResult = "ii"; } + +QtTestObject::QtTestObject(QObject *parent, int) + : QObject(parent) +{ slotResult = "i"; } + void QtTestObject::sl0() { slotResult = "sl0"; }; QString QtTestObject::sl1(QString s1) { slotResult = "sl1:" + s1; return "yessir"; } void QtTestObject::sl2(QString s1, QString s2) { slotResult = "sl2:" + s1 + s2; } @@ -572,6 +593,27 @@ QList<QString> QtTestObject::sl13(QList<QString> l1) { slotResult = "sl13"; return l1; } qint64 QtTestObject::sl14() { slotResult = "sl14"; return Q_INT64_C(123456789)*123456789; } +qlonglong *QtTestObject::sl15(qlonglong *ptr) +{ slotResult = "sl15"; return ptr; } +MyForwardDeclaredType *QtTestObject::sl16(MyForwardDeclaredType *ptr) +{ + slotResult = "sl16:"; + if (ptr) { + slotResult += "notnull"; + return nullptr; + } + slotResult += "null"; + return getForwardDeclaredPointer(); +} + +void QtTestObject::overloadedSlot() +{ slotResult = "overloadedSlot"; } + +void QtTestObject::overloadedSlot(int x, int y) +{ slotResult = "overloadedSlot:" + QString::number(x) + ',' + QString::number(y); } + +void QtTestObject::overloadedSlot(int x) +{ slotResult = "overloadedSlot:" + QString::number(x); } void QtTestObject::testReference(QString &str) { slotResult = "testReference:" + str; str = "gotcha"; } @@ -584,10 +626,10 @@ void QtTestObject::testSender() slotResult = QString::asprintf("%p", sender()); } -void QtTestObject::slotWithUnregisteredParameterType(MyUnregisteredType) +void QtTestObject::slotWithUnregisteredParameterType(const MyForwardDeclaredType &) { slotResult = "slotWithUnregisteredReturnType"; } -void QtTestObject::slotWithOneUnregisteredParameterType(QString a1, MyUnregisteredType) +void QtTestObject::slotWithOneUnregisteredParameterType(QString a1, const MyForwardDeclaredType &) { slotResult = "slotWithUnregisteredReturnType-" + a1; } void QtTestObject::staticFunction0() @@ -667,6 +709,11 @@ void tst_QMetaObject::invokeMetaMember() QVERIFY(QMetaObject::invokeMethod(&obj, "testReference", QGenericArgument("QString&", &refStr))); QCOMPARE(obj.slotResult, QString("testReference:whatever")); QCOMPARE(refStr, QString("gotcha")); + obj.slotResult.clear(); + refStr = "whatever"; + QVERIFY(QMetaObject::invokeMethod(&obj, "testReference", Q_ARG(QString&, refStr))); + QCOMPARE(obj.slotResult, QString("testReference:whatever")); + QCOMPARE(refStr, QString("gotcha")); qint64 ll1 = -1; quint64 ll2 = 0; @@ -717,6 +764,33 @@ void tst_QMetaObject::invokeMetaMember() QCOMPARE(return64, Q_INT64_C(123456789)*123456789); QCOMPARE(obj.slotResult, QString("sl14")); + // pointers + QVERIFY(QMetaObject::invokeMethod(&obj, "sl15", Q_ARG(qlonglong*, &return64))); + QCOMPARE(obj.slotResult, QString("sl15")); + QVERIFY(QMetaObject::invokeMethod(&obj, "sl16", Q_ARG(MyForwardDeclaredType*, getForwardDeclaredPointer()))); + QCOMPARE(obj.slotResult, QString("sl16:notnull")); + + obj.slotResult.clear(); + qint64 *return64Ptr; + QVERIFY(QMetaObject::invokeMethod(&obj, "sl15", Q_RETURN_ARG(qlonglong*, return64Ptr), Q_ARG(qlonglong*, &return64))); + QCOMPARE(return64Ptr, &return64); + QCOMPARE(obj.slotResult, QString("sl15")); + + obj.slotResult.clear(); + MyForwardDeclaredType *forwardPtr; + QVERIFY(QMetaObject::invokeMethod(&obj, "sl16", Q_RETURN_ARG(MyForwardDeclaredType*, forwardPtr), + Q_ARG(MyForwardDeclaredType*, nullptr))); + QCOMPARE(forwardPtr, getForwardDeclaredPointer()); + QCOMPARE(obj.slotResult, QString("sl16:null")); + + // test overloads + QVERIFY(QMetaObject::invokeMethod(&obj, "overloadedSlot")); + QCOMPARE(obj.slotResult, QString("overloadedSlot")); + QVERIFY(QMetaObject::invokeMethod(&obj, "overloadedSlot", Q_ARG(int, 1))); + QCOMPARE(obj.slotResult, QString("overloadedSlot:1")); + QVERIFY(QMetaObject::invokeMethod(&obj, "overloadedSlot", Q_ARG(int, 1), Q_ARG(int, 42))); + QCOMPARE(obj.slotResult, QString("overloadedSlot:1,42")); + //test signals QVERIFY(QMetaObject::invokeMethod(&obj, "sig0")); QCOMPARE(obj.slotResult, QString("sl0")); @@ -739,6 +813,9 @@ void tst_QMetaObject::invokeMetaMember() QTest::ignoreMessage(QtWarningMsg, "QMetaObject::invokeMethod: No such method QtTestObject::sl1(QString,QString,QString)\n" "Candidates are:\n sl1(QString)"); QVERIFY(!QMetaObject::invokeMethod(&obj, "sl1", Q_ARG(QString, "arg"), Q_ARG(QString, "arg"), Q_ARG(QString, "arg"))); + QTest::ignoreMessage(QtWarningMsg, "QMetaObject::invokeMethod: No such method QtTestObject::testReference(QString)\n" + "Candidates are:\n testReference(QString&)"); + QVERIFY(!QMetaObject::invokeMethod(&obj, "testReference", Q_ARG(QString, exp))); //should not have changed since last test. QCOMPARE(exp, QString("yessir")); @@ -835,6 +912,24 @@ void tst_QMetaObject::invokeQueuedMetaMember() qApp->processEvents(QEventLoop::AllEvents); QCOMPARE(obj.slotResult, QString("sl9:123456789")); + // pointers + qint64 return64; + obj.slotResult.clear(); + QVERIFY(QMetaObject::invokeMethod(&obj, "sl15", Qt::QueuedConnection, Q_ARG(qlonglong*, &return64))); + qApp->processEvents(QEventLoop::AllEvents); + QCOMPARE(obj.slotResult, QString("sl15")); + + // test overloads + QVERIFY(QMetaObject::invokeMethod(&obj, "overloadedSlot", Qt::QueuedConnection)); + qApp->processEvents(QEventLoop::AllEvents); + QCOMPARE(obj.slotResult, QString("overloadedSlot")); + QVERIFY(QMetaObject::invokeMethod(&obj, "overloadedSlot", Qt::QueuedConnection, Q_ARG(int, 1))); + qApp->processEvents(QEventLoop::AllEvents); + QCOMPARE(obj.slotResult, QString("overloadedSlot:1")); + QVERIFY(QMetaObject::invokeMethod(&obj, "overloadedSlot", Qt::QueuedConnection, Q_ARG(int, 1), Q_ARG(int, 42))); + qApp->processEvents(QEventLoop::AllEvents); + QCOMPARE(obj.slotResult, QString("overloadedSlot:1,42")); + // signals obj.slotResult.clear(); @@ -862,23 +957,38 @@ void tst_QMetaObject::invokeQueuedMetaMember() qApp->processEvents(QEventLoop::AllEvents); QCOMPARE(obj.slotResult, QString("testLongLong:-1,0")); + QTest::ignoreMessage(QtWarningMsg, "QMetaObject::invokeMethod: No such method QtTestObject::testReference(QString)\n" + "Candidates are:\n testReference(QString&)"); + QVERIFY(!QMetaObject::invokeMethod(&obj, "testReference", Qt::QueuedConnection, Q_ARG(QString, exp))); + + QString refStr = "whatever"; + QTest::ignoreMessage(QtWarningMsg, "QMetaMethod::invoke: Unable to handle unregistered datatype 'QString&'"); + QVERIFY(!QMetaObject::invokeMethod(&obj, "testReference", Qt::QueuedConnection, Q_ARG(QString&, refStr))); + QCOMPARE(refStr, "whatever"); + obj.slotResult.clear(); { - MyUnregisteredType t; - QTest::ignoreMessage(QtWarningMsg, "QMetaMethod::invoke: Unable to handle unregistered datatype 'MyUnregisteredType'"); - QVERIFY(!QMetaObject::invokeMethod(&obj, "slotWithUnregisteredParameterType", Qt::QueuedConnection, Q_ARG(MyUnregisteredType, t))); + const MyForwardDeclaredType &t = getForwardDeclaredType(); + QTest::ignoreMessage(QtWarningMsg, "QMetaMethod::invoke: Unable to handle unregistered datatype 'MyForwardDeclaredType'"); + QVERIFY(!QMetaObject::invokeMethod(&obj, "slotWithUnregisteredParameterType", Qt::QueuedConnection, Q_ARG(MyForwardDeclaredType, t))); QVERIFY(obj.slotResult.isEmpty()); } obj.slotResult.clear(); { QString a1("Cannot happen"); - MyUnregisteredType t; - QTest::ignoreMessage(QtWarningMsg, "QMetaMethod::invoke: Unable to handle unregistered datatype 'MyUnregisteredType'"); + const MyForwardDeclaredType &t = getForwardDeclaredType(); + QTest::ignoreMessage(QtWarningMsg, "QMetaMethod::invoke: Unable to handle unregistered datatype 'MyForwardDeclaredType'"); QVERIFY(!QMetaObject::invokeMethod(&obj, "slotWithOneUnregisteredParameterType", Qt::QueuedConnection, - Q_ARG(QString, a1), Q_ARG(MyUnregisteredType, t))); + Q_ARG(QString, a1), Q_ARG(MyForwardDeclaredType, t))); QVERIFY(obj.slotResult.isEmpty()); } + + obj.slotResult.clear(); + QTest::ignoreMessage(QtWarningMsg, "QMetaMethod::invoke: Unable to handle unregistered datatype 'MyForwardDeclaredType*'"); + QVERIFY(!QMetaObject::invokeMethod(&obj, "sl16", Qt::QueuedConnection, Q_ARG(MyForwardDeclaredType*, getForwardDeclaredPointer()))); + qApp->processEvents(QEventLoop::AllEvents); + QVERIFY(obj.slotResult.isEmpty()); } void tst_QMetaObject::invokeQueuedPointer() @@ -987,6 +1097,11 @@ void tst_QMetaObject::invokeBlockingQueuedMetaMember() QVERIFY(QMetaObject::invokeMethod(&obj, "testReference", Qt::BlockingQueuedConnection, QGenericArgument("QString&", &refStr))); QCOMPARE(obj.slotResult, QString("testReference:whatever")); QCOMPARE(refStr, QString("gotcha")); + obj.slotResult.clear(); + refStr = "whatever"; + QVERIFY(QMetaObject::invokeMethod(&obj, "testReference", Qt::BlockingQueuedConnection, Q_ARG(QString&, refStr))); + QCOMPARE(obj.slotResult, QString("testReference:whatever")); + QCOMPARE(refStr, QString("gotcha")); qint64 ll1 = -1; quint64 ll2 = 0; @@ -1031,6 +1146,40 @@ void tst_QMetaObject::invokeBlockingQueuedMetaMember() QCOMPARE(returnValue, argument); QCOMPARE(obj.slotResult, QString("sl13")); + // return qint64 + qint64 return64; + QVERIFY(QMetaObject::invokeMethod(&obj, "sl14", Qt::BlockingQueuedConnection, + Q_RETURN_ARG(qint64, return64))); + QCOMPARE(return64, Q_INT64_C(123456789)*123456789); + QCOMPARE(obj.slotResult, QString("sl14")); + + // pointers + QVERIFY(QMetaObject::invokeMethod(&obj, "sl15", Qt::BlockingQueuedConnection, Q_ARG(qlonglong*, &return64))); + QCOMPARE(obj.slotResult, QString("sl15")); + QVERIFY(QMetaObject::invokeMethod(&obj, "sl16", Qt::BlockingQueuedConnection, Q_ARG(MyForwardDeclaredType*, getForwardDeclaredPointer()))); + QCOMPARE(obj.slotResult, QString("sl16:notnull")); + + obj.slotResult.clear(); + qint64 *return64Ptr; + QVERIFY(QMetaObject::invokeMethod(&obj, "sl15", Qt::BlockingQueuedConnection, Q_RETURN_ARG(qlonglong*, return64Ptr), Q_ARG(qlonglong*, &return64))); + QCOMPARE(return64Ptr, &return64); + QCOMPARE(obj.slotResult, QString("sl15")); + + obj.slotResult.clear(); + MyForwardDeclaredType *forwardPtr; + QVERIFY(QMetaObject::invokeMethod(&obj, "sl16", Qt::BlockingQueuedConnection, Q_RETURN_ARG(MyForwardDeclaredType*, forwardPtr), + Q_ARG(MyForwardDeclaredType*, nullptr))); + QCOMPARE(forwardPtr, getForwardDeclaredPointer()); + QCOMPARE(obj.slotResult, QString("sl16:null")); + + // test overloads + QVERIFY(QMetaObject::invokeMethod(&obj, "overloadedSlot", Qt::BlockingQueuedConnection)); + QCOMPARE(obj.slotResult, QString("overloadedSlot")); + QVERIFY(QMetaObject::invokeMethod(&obj, "overloadedSlot", Qt::BlockingQueuedConnection, Q_ARG(int, 1))); + QCOMPARE(obj.slotResult, QString("overloadedSlot:1")); + QVERIFY(QMetaObject::invokeMethod(&obj, "overloadedSlot", Qt::BlockingQueuedConnection, Q_ARG(int, 1), Q_ARG(int, 42))); + QCOMPARE(obj.slotResult, QString("overloadedSlot:1,42")); + //test signals QVERIFY(QMetaObject::invokeMethod(&obj, "sig0", Qt::BlockingQueuedConnection)); QCOMPARE(obj.slotResult, QString("sl0")); @@ -1053,6 +1202,9 @@ void tst_QMetaObject::invokeBlockingQueuedMetaMember() QTest::ignoreMessage(QtWarningMsg, "QMetaObject::invokeMethod: No such method QtTestObject::sl1(QString,QString,QString)\n" "Candidates are:\n sl1(QString)"); QVERIFY(!QMetaObject::invokeMethod(&obj, "sl1", Qt::BlockingQueuedConnection, Q_ARG(QString, "arg"), Q_ARG(QString, "arg"), Q_ARG(QString, "arg"))); + QTest::ignoreMessage(QtWarningMsg, "QMetaObject::invokeMethod: No such method QtTestObject::testReference(QString)\n" + "Candidates are:\n testReference(QString&)"); + QVERIFY(!QMetaObject::invokeMethod(&obj, "testReference", Qt::BlockingQueuedConnection, Q_ARG(QString, exp))); //should not have changed since last test. QCOMPARE(exp, QString("yessir")); @@ -1231,6 +1383,24 @@ void tst_QMetaObject::invokeMetaConstructor() QTest::ignoreMessage(QtWarningMsg, "QMetaObject::newInstance: type MyGadget does not inherit QObject"); QVERIFY(!MyGadget::staticMetaObject.newInstance()); } + + // overloaded constructors + QObject parent; + { + QObject *obj = mo->newInstance(Q_ARG(QObject*, &parent)); + |