diff options
author | Mikolaj Boc <mikolaj.boc@qt.io> | 2023-03-10 12:44:26 +0100 |
---|---|---|
committer | Mikolaj Boc <mikolaj.boc@qt.io> | 2023-03-13 16:12:28 +0100 |
commit | d87ba73d48abaa25112e2248f6056d4cf9de8282 (patch) | |
tree | c8e236fea7378bbd560ef793f012701bcd78c0f0 /cmake/QtTestHelpers.cmake | |
parent | 5e4f4816a89673a2501abc458b28365bcf103c47 (diff) |
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>
Diffstat (limited to 'cmake/QtTestHelpers.cmake')
-rw-r--r-- | cmake/QtTestHelpers.cmake | 4 |
1 files changed, 2 insertions, 2 deletions
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}") |