From 4a9ed410750c8b111d33c52544388904244ec6e5 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Mon, 7 Dec 2020 16:21:19 +0100 Subject: CMake: Force crosscompiling_emulator to empty string if not found In some case CROSSCOMPILING_EMULATOR property is not INHERITED and is set to 'NOTFOUND' by get_test_property. Force it to empty string in this case. Add missed 'name' argument to '_qt_internal_wrap_test'. 'name' previously was used from parent scope. Pick-to: 6.0 Fixes: QTBUG-88053 Change-Id: I5286bcb9b11659f638e178ce52172dfee994fc34 Reviewed-by: Alexandru Croitor --- cmake/QtTestHelpers.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'cmake') diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake index 756be0ad4b..f849ba6037 100644 --- a/cmake/QtTestHelpers.cmake +++ b/cmake/QtTestHelpers.cmake @@ -321,7 +321,7 @@ function(qt_internal_add_test name) add_test(NAME "${name}" COMMAND ${test_executable} ${extra_test_args} WORKING_DIRECTORY "${test_working_dir}") else() - _qt_internal_wrap_test("${test_executable}" "${extra_test_args}" "${test_working_dir}" + _qt_internal_wrap_test("${name}" "${test_executable}" "${extra_test_args}" "${test_working_dir}" ENVIRONMENT "QT_TEST_RUNNING_IN_CTEST" 1 "PATH" "${test_env_path}" "QT_PLUGIN_PATH" "${plugin_paths_joined}") @@ -416,8 +416,8 @@ endfunction() # This function wraps test with cmake script, that makes possible standalone run with external # arguments. -function(_qt_internal_wrap_test test_executable extra_test_args test_working_dir) - cmake_parse_arguments(PARSE_ARGV 3 arg "" "" "ENVIRONMENT") +function(_qt_internal_wrap_test name test_executable extra_test_args test_working_dir) + cmake_parse_arguments(PARSE_ARGV 4 arg "" "" "ENVIRONMENT") set(environment_extras) set(skipNext false) @@ -466,6 +466,9 @@ function(_qt_internal_wrap_test test_executable extra_test_args test_working_dir # emulator is prepended independently. if(CMAKE_CROSSCOMPILING) get_test_property(${name} CROSSCOMPILING_EMULATOR crosscompiling_emulator) + if(NOT crosscompiling_emulator) + set(crosscompiling_emulator "") + endif() endif() if(WIN32) -- cgit v1.2.3