From 65b7aacb4051d82bf0cb8bfc684f3404dd0bc4a7 Mon Sep 17 00:00:00 2001 From: Mikolaj Boc Date: Tue, 29 Nov 2022 16:19:54 +0100 Subject: Add a dummy target for tests that get batched This is done to avoid cmake syntax errors when adding new tests. Change-Id: I8106b13a865b990c52e09573488881bd18e64c7f Reviewed-by: Alexandru Croitor --- cmake/QtTestHelpers.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cmake/QtTestHelpers.cmake') diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake index 81a2c7b9ba..b8b2485175 100644 --- a/cmake/QtTestHelpers.cmake +++ b/cmake/QtTestHelpers.cmake @@ -371,6 +371,16 @@ function(qt_internal_add_test_to_batch batch_name name) "BATCHED_TEST_NAME=\"${name}\"") endforeach() set(${batch_name} ${target} PARENT_SCOPE) + + # Add a dummy target so that new tests don't have problems with a nonexistent + # target when calling cmake functions. + # The batch tests that include this target will compile, but may fail to work. + # Manual action is required then. + add_custom_target(${name}) + + # Add the dependency to the dummy target so that it is indirectly added to the test batch + # dependencies. + add_dependencies(${target} ${name}) endfunction() # Checks whether the test 'name' is present in the test batch. See QT_BUILD_TESTS_BATCHED. -- cgit v1.2.3