diff options
Diffstat (limited to 'tests/auto/cmake/CMakeLists.txt')
-rw-r--r-- | tests/auto/cmake/CMakeLists.txt | 106 |
1 files changed, 98 insertions, 8 deletions
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index 99d36c3d56..b159de7c9c 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -1,8 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: BSD-3-Clause -# special case skip regeneration - # This is an automatic test for the CMake configuration files. # To run it manually, # 1) mkdir build # Create a build directory @@ -71,7 +69,8 @@ enable_testing() # flag. Notably -rpath is specified which should implicitly enable -rpath-link, but that # doesn't seem to be the case. # Until this is figured out, disable the tests when cross-compiling to Linux. -if(UNIX AND NOT APPLE AND NOT WIN32 AND CMAKE_CROSSCOMPILING AND NOT QT_ENABLE_CMAKE_BOOT2QT_TESTS) +if(UNIX AND NOT APPLE AND NOT WIN32 AND CMAKE_CROSSCOMPILING AND NOT QT_ENABLE_CMAKE_BOOT2QT_TESTS + AND NOT QT_BUILD_MINIMAL_ANDROID_MULTI_ABI_TESTS) message(STATUS "Running CMake tests is disabled when cross-compiling to Linux / Boot2Qt.") return() endif() @@ -113,6 +112,43 @@ endif() include("${_Qt6CTestMacros}") +# Test only multi-abi specific functionality when QT_BUILD_MINIMAL_ANDROID_MULTI_ABI_TESTS is ON. +# Qt::Gui is the prerequisite for all Android tests. +if(QT_BUILD_MINIMAL_ANDROID_MULTI_ABI_TESTS AND NOT NO_GUI) + unset(multi_abi_vars) + foreach(abi IN LISTS QT_ANDROID_ABIS) + list(APPEND multi_abi_vars "-DQT_PATH_ANDROID_ABI_${abi}=${QT_PATH_ANDROID_ABI_${abi}}") + endforeach() + if(QT_ANDROID_BUILD_ALL_ABIS) + list(APPEND multi_abi_vars "-DQT_ANDROID_BUILD_ALL_ABIS=${QT_ANDROID_BUILD_ALL_ABIS}") + endif() + + list(APPEND multi_abi_vars "-DQT_HOST_PATH=${QT_HOST_PATH}") + + set(multi_abi_forward_vars + TEST_SINGLE_VALUE_ARG + TEST_SPACES_VALUE_ARG + TEST_LIST_VALUE_ARG + TEST_ESCAPING_VALUE_ARG + ) + string(REPLACE ";" "[[;]]" multi_abi_forward_vars "${multi_abi_forward_vars}") + + set(single_value "TestValue") + set(list_value "TestValue[[;]]TestValue2[[;]]TestValue3") + set(escaping_value "TestValue\\\\[[;]]TestValue2\\\\[[;]]TestValue3") + set(spaces_value "TestValue TestValue2 TestValue3") + _qt_internal_test_expect_pass(test_android_multi_abi_forward_vars + BUILD_OPTIONS + ${multi_abi_vars} + "-DQT_ANDROID_MULTI_ABI_FORWARD_VARS=${multi_abi_forward_vars}" + "-DTEST_SINGLE_VALUE_ARG=${single_value}" + "-DTEST_LIST_VALUE_ARG=${list_value}" + "-DTEST_ESCAPING_VALUE_ARG=${escaping_value}" + "-DTEST_SPACES_VALUE_ARG=${spaces_value}" + ) + return() +endif() + if(NOT NO_WIDGETS) _qt_internal_test_expect_pass(test_build_simple_widget_app) set(extra_widget_app_options "") @@ -161,6 +197,7 @@ endif() _qt_internal_test_expect_pass(test_add_resource_prefix BINARY test_add_resource_prefix) _qt_internal_test_expect_build_fail(test_add_resource_options) _qt_internal_test_expect_build_fail(test_wrap_cpp_options) +_qt_internal_test_expect_pass(test_wrap_cpp_moc) _qt_internal_test_expect_pass(test_platform_defs_include) _qt_internal_test_expect_pass(test_qtmainwin_library) @@ -185,6 +222,8 @@ endif() _qt_internal_test_expect_pass(test_multiple_find_package) _qt_internal_test_expect_pass(test_add_resources_delayed_file) _qt_internal_test_expect_pass(test_add_binary_resources_delayed_file BINARY test_add_binary_resources_delayed_file) +_qt_internal_test_expect_pass(test_qt_add_resources_rebuild) +_qt_internal_test_expect_pass(test_resource_without_obj_lib BINARY test_resource_without_obj_lib) if(NOT NO_GUI) _qt_internal_test_expect_pass(test_private_includes) @@ -274,10 +313,11 @@ if(QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX) elseif(QT6_INSTALL_PREFIX) set(qt_install_prefix "${QT6_INSTALL_PREFIX}") endif() -if(INSTALL_BINDIR) - set(qt_install_bin_dir "${INSTALL_BINDIR}") -elseif(QT6_INSTALL_BINS) - set(qt_install_bin_dir "${QT6_INSTALL_BINS}") + +if(INSTALL_LIBEXECDIR) + set(qt_install_libexec_dir "${INSTALL_LIBEXECDIR}") +elseif(QT6_INSTALL_LIBEXECS) + set(qt_install_libexec_dir "${QT6_INSTALL_LIBEXECS}") endif() # Test building and installing a few dummy Qt modules and plugins. @@ -288,7 +328,7 @@ if(is_qt_build_platform) 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" + -P "${qt_install_prefix}/${qt_install_libexec_dir}/qt-cmake-private-install.cmake" ) endif() _qt_internal_test_expect_pass(mockplugins ${mockplugins_test_args}) @@ -299,6 +339,12 @@ if(is_qt_build_platform) set_tests_properties(test_import_plugins PROPERTIES FIXTURES_REQUIRED build_mockplugins) endif() +if(NOT NO_GUI) + _qt_internal_test_expect_pass(test_standalone_test + BINARY "${CMAKE_CTEST_COMMAND}" + BINARY_ARGS "-V") +endif() + _qt_internal_test_expect_pass(test_versionless_targets) if(NOT NO_GUI) @@ -350,3 +396,47 @@ if(WIN32 OR (APPLE AND NOT IOS) OR is_desktop_linux) else() _qt_internal_test_expect_fail(${deploy_args}) endif() + +_qt_internal_test_expect_pass(test_config_expressions) +_qt_internal_test_expect_pass(test_QTP0003) + +if(NOT NO_GUI) + _qt_internal_test_expect_pass(test_collecting_plugins) +endif() + +_qt_internal_test_expect_pass(test_qt_manual_moc) + +# check if the os is opensuse. If it is, we need to skip tests due to CI problems +set(is_opensuse FALSE) +if(UNIX) + if(EXISTS "/etc/os-release") + file(STRINGS "/etc/os-release" os_release_content) + foreach(line IN LISTS os_release_content) + if(line MATCHES "openSUSE" OR line MATCHES "opensuse") + set(is_opensuse TRUE) + break() + endif() + endforeach() + endif() +endif() + +if(NOT QNX AND NOT WASM AND NOT (WIN32 AND QT_BUILD_MINIMAL_STATIC_TESTS) + AND NOT is_opensuse) + # Since our CI machines are slow, ctest --build-and-test buffers the output + # of the configure step of a test, and the fact that we run all the test + # logic in the configure step, we need to divide the tests into smaller + # chunks to avoid CI stdout timeout errors. + # See https://gitlab.kitware.com/cmake/cmake/-/issues/25790 + _qt_internal_test_expect_pass(test_qt_add_ui_common) + _qt_internal_test_expect_pass(test_qt_add_ui_1) + _qt_internal_test_expect_pass(test_qt_add_ui_2) + _qt_internal_test_expect_pass(test_qt_add_ui_3) + _qt_internal_test_expect_pass(test_qt_add_ui_4) + _qt_internal_test_expect_pass(test_qt_add_ui_5) + _qt_internal_test_expect_pass(test_qt_add_ui_6) + _qt_internal_test_expect_pass(test_qt_add_ui_7) + _qt_internal_test_expect_pass(test_qt_add_ui_8) + _qt_internal_test_expect_pass(test_qt_add_ui_9) + _qt_internal_test_expect_pass(test_qt_add_ui_10) +endif() + |