Set target property _qt_is_test_executable on all tests

This is needed to later determine what kind of runner should be
selected on WASM for the executable. Tests use the test runner,
whereas other executables use qtLoader.

Change-Id: I75aa361403b72f8e82a288967b8a81b8232d68dc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Mikolaj Boc 2022-09-07 14:54:37 +02:00
parent c8cf0f17b8
commit 62c681a599
2 changed files with 3 additions and 2 deletions

View File

@ -507,6 +507,7 @@ function(qt_internal_add_test name)
)
set(setting_up_batched_test FALSE)
endif()
set_target_properties(${name} PROPERTIES _qt_is_test_executable TRUE)
foreach(path IN LISTS arg_QML_IMPORTPATH)
list(APPEND extra_test_args "-import" "${path}")

View File

@ -23,10 +23,10 @@ function(_qt_internal_wasm_add_target_helpers target)
set(APPNAME ${_target_output_name})
_qt_internal_test_batch_target_name(test_batch_target_name)
get_target_property(target_output_directory ${target} RUNTIME_OUTPUT_DIRECTORY)
if(QT_BUILD_TESTS_BATCHED AND target STREQUAL test_batch_target_name)
get_target_property(is_test ${target} _qt_is_test_executable)
if(is_test)
configure_file("${WASM_BUILD_DIR}/libexec/batchedtestrunner.html"
"${target_output_directory}/batchedtestrunner.html" COPYONLY)
configure_file("${WASM_BUILD_DIR}/libexec/batchedtestrunner.js"