CMake: Add "cmake" keyword for test blacklisting

Certain tests fail only on CMake configurations. We need the
capability to ignore these failures, without removing the
qmake-built-Qt coverage for now.

The keyword is enabled when Qt is built with CMake. So it doesn't
matter if the final test is built with CMake or qmake.

Task-number: QTBUG-85364
Change-Id: I157fe3d9254b589ef1e84022c01f4487ff834d27
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Alexandru Croitor 2020-07-01 11:00:00 +02:00
parent ab6861b01f
commit bb5757f0cd
2 changed files with 9 additions and 1 deletions

View File

@ -133,4 +133,7 @@ qt_add_docs(Test
# special case begin
qt_apply_testlib_coverage_options(Test)
# Allow blacklisting tests depending on whether testlib was built as part of a CMake build.
target_compile_definitions(Test PRIVATE QT_CMAKE_BUILD)
# special case end

View File

@ -58,7 +58,8 @@ QT_BEGIN_NAMESPACE
referring to this documentation is kind to readers. Comments can also be used
to indicate the reasons for ignoring particular cases.
The key "ci" applies only when run by COIN. Other keys name platforms,
The key "ci" applies only when run by COIN.
The key "cmake" applies when Qt is built using CMake. Other keys name platforms,
operating systems, distributions, tool-chains or architectures; a ! prefix
reverses what it checks. A version, joined to a key (at present, only for
distributions and for msvc) with a hyphen, limits the key to the specific
@ -164,6 +165,10 @@ static QSet<QByteArray> keywords()
#ifdef QT_BUILD_INTERNAL
<< "developer-build"
#endif
#ifdef QT_CMAKE_BUILD
<< "cmake"
#endif
;
#if QT_CONFIG(properties)