From 6c12ea1d45c9f4e8fb718a0a2a9eb4dc9f8b37b1 Mon Sep 17 00:00:00 2001 From: Mikolaj Boc Date: Tue, 21 Feb 2023 14:07:31 +0100 Subject: [PATCH] Skip non-qtbase tests on Coin The previous attempt failed as target coin configuration doesn't use superbuild. Skip the tests based on the TESTED_MODULE_COIN environment variable Task-number: QTBUG-109786 Change-Id: I0dbe6ff64ca4a2e81fef377865ef4e99b58c5eb2 Reviewed-by: Joerg Bornemann --- cmake/QtTestHelpers.cmake | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake index 725c3fa0be..6f94ca915d 100644 --- a/cmake/QtTestHelpers.cmake +++ b/cmake/QtTestHelpers.cmake @@ -466,15 +466,22 @@ function(qt_internal_add_test name) ) _qt_internal_validate_all_args_are_parsed(arg) - if(QT_BUILD_TESTS_BATCHED AND QT_SUPERBUILD AND NOT arg_NO_BATCH AND NOT arg_QMLTEST) - qt_internal_is_qtbase_test(is_qtbase_test) - if(NOT is_qtbase_test) - file(GENERATE OUTPUT "dummy${name}.cpp" CONTENT "int main() { return 0; }") - # Add a dummy target to tackle some potential problems - qt_internal_add_executable(${name} SOURCES "dummy${name}.cpp") - # Batched tests outside of qtbase are unsupported and skipped - qt_internal_set_skipped_test(${name}) - return() + if(QT_BUILD_TESTS_BATCHED AND NOT arg_NO_BATCH AND NOT arg_QMLTEST) + if (QT_SUPERBUILD OR DEFINED ENV{TESTED_MODULE_COIN}) + set(is_qtbase_test FALSE) + if(QT_SUPERBUILD) + qt_internal_is_qtbase_test(is_qtbase_test) + elseif($ENV{TESTED_MODULE_COIN} STREQUAL "qtbase") + set(is_qtbase_test TRUE) + endif() + if(NOT is_qtbase_test) + file(GENERATE OUTPUT "dummy${name}.cpp" CONTENT "int main() { return 0; }") + # Add a dummy target to tackle some potential problems + qt_internal_add_executable(${name} SOURCES "dummy${name}.cpp") + # Batched tests outside of qtbase are unsupported and skipped + qt_internal_set_skipped_test(${name}) + return() + endif() endif() endif()