Skip to content

Commit

Permalink
cmake prepared for QT_SKIP_DEFAULT_TESTCASE_DIRS
Browse files Browse the repository at this point in the history
Prepared code for QT_SKIP_DEFAULT_TESTCASE_DIRS that should be released
in the Qt v6.9.

See: https://bugreports.qt.io/projects/QTBUG/issues/QTBUG-126729
  • Loading branch information
silverqx committed Aug 18, 2024
1 parent 7aaea4c commit 7a01267
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cmake/Modules/TinyTestCommon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ function(tiny_configure_test_pch name provides_pch)
target_compile_definitions(${name} PRIVATE TINYORM_USING_PCH)
endif()

# Qt <v6.8.0 breaks REUSE_FROM (was/will be fixed in Qt v6.8.0-beta3)
# Qt <v6.9.0 breaks REUSE_FROM (will be fixed in Qt v6.9.0)
# See: https://bugreports.qt.io/projects/QTBUG/issues/QTBUG-126729
# Also, I have patched the Qt6TestTargets.cmake so the REUSE_FROM work for me because
# of this I need to skip this if() using the TINY_QT6_TEST_TARGET_PATCHED environment
# variable, it also affects CI pipelines on GitHub self-hosted runners
if(TINY_QT_VERSION VERSION_LESS "6.8.0" AND
if(TINY_QT_VERSION VERSION_LESS "6.9.0" AND
NOT (DEFINED ENV{TINY_QT6_TEST_TARGET_PATCHED} AND
"$ENV{TINY_QT6_TEST_TARGET_PATCHED}")
)
Expand All @@ -154,6 +154,12 @@ function(tiny_configure_test_pch name provides_pch)
return()
endif()

# Disable QT_TESTCASE_BUILDDIR/SOURCEDIR compile definitions for REUSE_FROM to work,
# this property doesn't exist in my patched Qt6TestTargets.cmake
if(TINY_QT_VERSION VERSION_GREATER_EQUAL "6.9.0")
set_target_properties(${name} PROPERTIES QT_SKIP_DEFAULT_TESTCASE_DIRS YES)
endif()

if(provides_pch)
# Throw an exception if CACHE{TINY_TESTS_PCH_REUSE_FROM} isn't equal to the name
tiny_throw_if_wrong_reuse_from(${name})
Expand Down

0 comments on commit 7a01267

Please sign in to comment.