CMake: Enable public executable finalizers for iOS tests
This ensures that tests can be executed on the simulator or device, by doing the necessary steps like setting a bundle identifier, Info.plist file, launch screen, etc. This is done by calling _qt_internal_finalize_executable in the implementation of all internal test adding functions. The finalizers are limited only to iOS for now, as an incremental step, and to ensure we don't accidentally break tests on other platforms. At least WebAssembly uses its own finalizers which would likely cause duplicate calls if the _qt_internal_finalize_executable was unconditional. Fixes: QTBUG-104754 Change-Id: I729d56385dd206b22c975fc2ce4e2c683e6e4e2c Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 6c9f4f5ebcd35dc1a68c442d9fbf3ec48f30baca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
d5eae411bc
commit
0fac2ae499
@ -65,6 +65,8 @@ function(qt_internal_add_benchmark target)
|
||||
if (TARGET benchmark)
|
||||
add_dependencies("benchmark" "${target}_benchmark")
|
||||
endif()
|
||||
|
||||
qt_internal_add_test_finalizers("${target}")
|
||||
endfunction()
|
||||
|
||||
# Simple wrapper around qt_internal_add_executable for manual tests which insure that
|
||||
@ -110,6 +112,7 @@ function(qt_internal_add_manual_test target)
|
||||
# Disable the QT_NO_NARROWING_CONVERSIONS_IN_CONNECT define for manual tests
|
||||
qt_internal_undefine_global_definition(${target} QT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
|
||||
|
||||
qt_internal_add_test_finalizers("${target}")
|
||||
endfunction()
|
||||
|
||||
# This function will configure the fixture for the network tests that require docker network services
|
||||
@ -481,6 +484,7 @@ function(qt_internal_add_test name)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
qt_internal_add_test_finalizers("${name}")
|
||||
endfunction()
|
||||
|
||||
# This function adds test with specified NAME and wraps given test COMMAND with standalone cmake
|
||||
@ -744,3 +748,14 @@ function(qt_internal_collect_command_environment out_path out_plugin_path)
|
||||
string(REPLACE ";" "\;" plugin_paths_joined "${plugin_paths_joined}")
|
||||
set(${out_plugin_path} "${plugin_paths_joined}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(qt_internal_add_test_finalizers target)
|
||||
# It might not be safe to run all the finalizers of _qt_internal_finalize_executable
|
||||
# within the context of a Qt build (not a user project) when targeting a host build.
|
||||
# At least one issue is missing qmlimportscanner at configure time.
|
||||
# For now, we limit it to iOS, where it was tested to work, an we know that host tools
|
||||
# should already be built and available.
|
||||
if(IOS)
|
||||
qt_add_list_file_finalizer(_qt_internal_finalize_executable "${target}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
Loading…
x
Reference in New Issue
Block a user