From d87ba73d48abaa25112e2248f6056d4cf9de8282 Mon Sep 17 00:00:00 2001 From: Mikolaj Boc Date: Fri, 10 Mar 2023 12:44:26 +0100 Subject: Avoid error with test helper when test batch is missing qt_internal_add_test_helper will fail if a test batch is missing and batching is enabled. It will now copy to the parent binary directory as without batching for simplicity, as this happens when batched tests are skipped. One consequence could be that when the first test specified has the NO_BATCH argument, this will incorrectly install the helper, but helpers still need extra work to function properly, so for now we just make it compile. Task-number: QTBUG-109786 Change-Id: Ib307ae79799422c2a4102885aa007ef043835e50 Reviewed-by: Alexandru Croitor --- cmake/QtTestHelpers.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmake/QtTestHelpers.cmake') diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake index bab6406a87..fb349078f8 100644 --- a/cmake/QtTestHelpers.cmake +++ b/cmake/QtTestHelpers.cmake @@ -877,8 +877,8 @@ function(qt_internal_add_test_helper name) set(extra_args_to_pass) if(NOT arg_OVERRIDE_OUTPUT_DIRECTORY) - if(QT_BUILD_TESTS_BATCHED) - _qt_internal_test_batch_target_name(test_batch_target_name) + _qt_internal_test_batch_target_name(test_batch_target_name) + if(QT_BUILD_TESTS_BATCHED AND TARGET ${test_batch_target_name}) get_target_property( test_batch_output_dir ${test_batch_target_name} RUNTIME_OUTPUT_DIRECTORY) set(extra_args_to_pass OUTPUT_DIRECTORY "${test_batch_output_dir}") -- cgit v1.2.3