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 <alexandru.croitor@qt.io>
This commit is contained in:
Mikolaj Boc 2023-03-10 12:44:26 +01:00
parent 5e4f4816a8
commit d87ba73d48

View File

@ -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}")