diff options
Diffstat (limited to 'tests/auto/cmake')
17 files changed, 94 insertions, 5 deletions
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index b159de7c9c..86db954086 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -146,6 +146,21 @@ if(QT_BUILD_MINIMAL_ANDROID_MULTI_ABI_TESTS AND NOT NO_GUI) "-DTEST_ESCAPING_VALUE_ARG=${escaping_value}" "-DTEST_SPACES_VALUE_ARG=${spaces_value}" ) + + #Run test_android_aar only if the host is Unix and zipinfo is available + find_program(ZIPINFO_EXECUTABLE zipinfo) + if(CMAKE_HOST_UNIX AND ZIPINFO_EXECUTABLE) + _qt_internal_test_expect_pass(test_android_aar + BUILD_OPTIONS + ${multi_abi_vars} + --build-target verify_aar + ) + else() + message(WARNING + "Skipping test_android_aar CMake build test because \ + the host is not Unix or zipinfo is not found") + endif() + return() endif() diff --git a/tests/auto/cmake/mockplugins/.cmake.conf b/tests/auto/cmake/mockplugins/.cmake.conf index 10bc1fd407..6d83b084f7 100644 --- a/tests/auto/cmake/mockplugins/.cmake.conf +++ b/tests/auto/cmake/mockplugins/.cmake.conf @@ -1 +1 @@ -set(QT_REPO_MODULE_VERSION "6.8.0") +set(QT_REPO_MODULE_VERSION "6.9.0") diff --git a/tests/auto/cmake/mockplugins/mock1plugin/qmock1plugin.cpp b/tests/auto/cmake/mockplugins/mock1plugin/qmock1plugin.cpp index 2ee817d80a..a2994c10e3 100644 --- a/tests/auto/cmake/mockplugins/mock1plugin/qmock1plugin.cpp +++ b/tests/auto/cmake/mockplugins/mock1plugin/qmock1plugin.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "qmock1plugin.h" QT_BEGIN_NAMESPACE diff --git a/tests/auto/cmake/mockplugins/mock2plugin/qmock2plugin.cpp b/tests/auto/cmake/mockplugins/mock2plugin/qmock2plugin.cpp index 5b3280e884..8e10797997 100644 --- a/tests/auto/cmake/mockplugins/mock2plugin/qmock2plugin.cpp +++ b/tests/auto/cmake/mockplugins/mock2plugin/qmock2plugin.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "qmock2plugin.h" QT_BEGIN_NAMESPACE diff --git a/tests/auto/cmake/mockplugins/mock3plugin/qmock3plugin.cpp b/tests/auto/cmake/mockplugins/mock3plugin/qmock3plugin.cpp index b38f854e4b..53090472e0 100644 --- a/tests/auto/cmake/mockplugins/mock3plugin/qmock3plugin.cpp +++ b/tests/auto/cmake/mockplugins/mock3plugin/qmock3plugin.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "qmock3plugin.h" QT_BEGIN_NAMESPACE diff --git a/tests/auto/cmake/mockplugins/mock4plugin/qmock4plugin.cpp b/tests/auto/cmake/mockplugins/mock4plugin/qmock4plugin.cpp index 5deaf7f43f..f2a904182d 100644 --- a/tests/auto/cmake/mockplugins/mock4plugin/qmock4plugin.cpp +++ b/tests/auto/cmake/mockplugins/mock4plugin/qmock4plugin.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "qmock4plugin.h" QT_BEGIN_NAMESPACE diff --git a/tests/auto/cmake/mockplugins/mock5plugin/qmock5plugin.cpp b/tests/auto/cmake/mockplugins/mock5plugin/qmock5plugin.cpp index c5b4620516..92ea47690f 100644 --- a/tests/auto/cmake/mockplugins/mock5plugin/qmock5plugin.cpp +++ b/tests/auto/cmake/mockplugins/mock5plugin/qmock5plugin.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "qmock5plugin.h" QT_BEGIN_NAMESPACE diff --git a/tests/auto/cmake/mockplugins/mock6plugin/qmock6plugin.cpp b/tests/auto/cmake/mockplugins/mock6plugin/qmock6plugin.cpp index 4a0329c68a..9dd9e02f2a 100644 --- a/tests/auto/cmake/mockplugins/mock6plugin/qmock6plugin.cpp +++ b/tests/auto/cmake/mockplugins/mock6plugin/qmock6plugin.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "qmock6plugin.h" QT_BEGIN_NAMESPACE diff --git a/tests/auto/cmake/test_android_aar/CMakeLists.txt b/tests/auto/cmake/test_android_aar/CMakeLists.txt new file mode 100644 index 0000000000..88cd5abf23 --- /dev/null +++ b/tests/auto/cmake/test_android_aar/CMakeLists.txt @@ -0,0 +1,54 @@ +# Copyright (C) 2024 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.16) + +project(test_android_aar) + +find_package(Qt6 COMPONENTS Core Gui REQUIRED) + +qt6_add_executable(test_aar main.cpp) + +# To support opening the project in QtCreator +if($CACHE{QT_USE_TARGET_ANDROID_BUILD_DIR}) + set(TARGET_ANDROID_BUILD_DIR ${CMAKE_BINARY_DIR}/android-build-test_aar) +else() + set(TARGET_ANDROID_BUILD_DIR ${CMAKE_BINARY_DIR}/android-build) +endif() + +# Add common libs for available ABIs that should be present in the aar package in a list +unset(aar_content_filepaths_to_verify) +foreach(abi IN LISTS QT_ANDROID_ABIS) + list(APPEND aar_content_filepaths_to_verify "jni/${abi}/libQt6Core_${abi}.so") + list(APPEND aar_content_filepaths_to_verify "jni/${abi}/libQt6Gui_${abi}.so") + list(APPEND aar_content_filepaths_to_verify + "jni/${abi}/libplugins_platforms_qtforandroid_${abi}.so") + list(APPEND aar_content_filepaths_to_verify "jni/${abi}/libtest_aar_${abi}.so") +endforeach() + +# Add a few ABI independent file that should be present in the aar package in a list +list(APPEND aar_content_filepaths_to_verify "libs/Qt6Android.jar") +list(APPEND aar_content_filepaths_to_verify "res/xml/qtprovider_paths.xml") +list(APPEND aar_content_filepaths_to_verify "AndroidManifest.xml") +list(JOIN aar_content_filepaths_to_verify "|" grep_pattern) + +# The overall number of lines we should expect to be filtered by grep regex +list(LENGTH aar_content_filepaths_to_verify expected_file_count) + +set(zipinfo_command "zipinfo -1 ${TARGET_ANDROID_BUILD_DIR}/test_aar.aar") + +# Runs zipinfo on the aar package, greps and outputs the number of matching lines +# and finally compares the expected number of lines with the output +add_custom_target(verify_aar + bash -c "${zipinfo_command} \ + | grep -Ecx '${grep_pattern}' \ + | grep -xq ${expected_file_count} \ + || { echo 'Error: The aar package is missing at least one file.'; exit 1; };" + COMMENT "Verifying aar package content" + VERBATIM +) + +# Build aar package before verification +add_dependencies(verify_aar aar) + +target_link_libraries(test_aar PRIVATE Qt::Core Qt::Gui) diff --git a/tests/auto/cmake/test_android_aar/main.cpp b/tests/auto/cmake/test_android_aar/main.cpp new file mode 100644 index 0000000000..90df9ee937 --- /dev/null +++ b/tests/auto/cmake/test_android_aar/main.cpp @@ -0,0 +1,4 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +int main(int, char *[]) { return 0; } diff --git a/tests/auto/cmake/test_generating_cpp_exports/.cmake.conf b/tests/auto/cmake/test_generating_cpp_exports/.cmake.conf index 10bc1fd407..6d83b084f7 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.8.0") +set(QT_REPO_MODULE_VERSION "6.9.0") 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 0e446dd108..f1cc6906f8 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 @@ -3,7 +3,6 @@ qt_internal_add_module(TestAutogeneratingCppExports NO_UNITY_BUILD - GENERATE_CPP_EXPORTS SOURCES module_api.h module_api.cpp 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 8473979c70..87a83bd013 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 @@ -3,7 +3,6 @@ qt_internal_add_module(TestAutogeneratingCppExportsCustomName NO_UNITY_BUILD - GENERATE_CPP_EXPORTS CPP_EXPORT_HEADER_BASE_NAME "customname_exports" SOURCES diff --git a/tests/auto/cmake/test_interface/widget_test/main.cpp b/tests/auto/cmake/test_interface/widget_test/main.cpp index e6a8ab5fe9..0a47f43d84 100644 --- a/tests/auto/cmake/test_interface/widget_test/main.cpp +++ b/tests/auto/cmake/test_interface/widget_test/main.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QString> #include <QWidget> diff --git a/tests/auto/cmake/test_moc_macro_target/check_moc_parameters.cmake b/tests/auto/cmake/test_moc_macro_target/check_moc_parameters.cmake index 4ca8fab119..5388816c07 100644 --- a/tests/auto/cmake/test_moc_macro_target/check_moc_parameters.cmake +++ b/tests/auto/cmake/test_moc_macro_target/check_moc_parameters.cmake @@ -1,4 +1,6 @@ +# Copyright (C) 2024 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause function(check_parameters file_path) file(READ ${file_path} file_content) foreach(compile_option IN ITEMS "-DDEFINE_CMDLINE_SIGNAL" "-DMY_OPTION") diff --git a/tests/auto/cmake/test_qt_add_resources_rebuild/sample/CMakeLists.txt b/tests/auto/cmake/test_qt_add_resources_rebuild/sample/CMakeLists.txt index 0a40a948c6..1696eae261 100644 --- a/tests/auto/cmake/test_qt_add_resources_rebuild/sample/CMakeLists.txt +++ b/tests/auto/cmake/test_qt_add_resources_rebuild/sample/CMakeLists.txt @@ -1,3 +1,5 @@ +# Copyright (C) 2024 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause cmake_minimum_required(VERSION 3.16) project(sample LANGUAGES CXX) diff --git a/tests/auto/cmake/test_static_resources/.cmake.conf b/tests/auto/cmake/test_static_resources/.cmake.conf index 10bc1fd407..6d83b084f7 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.8.0") +set(QT_REPO_MODULE_VERSION "6.9.0") |