summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2022-07-27 19:06:39 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-09-01 17:44:33 +0000
commit863e308e6b49e3ea263c518cd9491daabb41e1d4 (patch)
treea4b25c62a2936f58ac78aee9d8e9c2303c0279b8
parent9516fe526ef7a57a9507feb84f20a6dd53e0b279 (diff)
Provide CMake guidance for skipping whole tests
The testlib docs on how to skip whole tests was qmake-specific, so add the missing details for CMake. Change-Id: I247d08262302dcedb98ffbf301932d6dd84d7ff7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> (cherry picked from commit 8814fb5f4faff2d8442e481feb1bb35c2250e930) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/testlib/doc/src/qttest-best-practices.qdoc19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/testlib/doc/src/qttest-best-practices.qdoc b/src/testlib/doc/src/qttest-best-practices.qdoc
index 57f07d4a16..3980b453f7 100644
--- a/src/testlib/doc/src/qttest-best-practices.qdoc
+++ b/src/testlib/doc/src/qttest-best-practices.qdoc
@@ -198,11 +198,20 @@
attempt to run a slot that is not implemented. In the second case, the
test will not attempt to run a test slot even though it should.
- If an entire test program is inapplicable for a specific platform or
- unless a particular feature is enabled, the best approach is to use the
- parent directory's \c .pro file to avoid building the test. For example,
- if the \c tests/auto/gui/someclass test is not valid for \macOS, add the
- following line to \c tests/auto/gui.pro:
+ If an entire test program is inapplicable for a specific platform or unless
+ a particular feature is enabled, the best approach is to use the parent
+ directory's build configuration to avoid building the test. For example, if
+ the \c tests/auto/gui/someclass test is not valid for \macOS, wrap its
+ inclusion as a subdirectory in \c{tests/auto/gui/CMakeLists.txt} in a
+ platform check:
+
+ \badcode
+ if(NOT APPLE)
+ add_subdirectory(someclass)
+ endif
+ \endcode
+
+ or, if using \c qmake, add the following line to \c tests/auto/gui.pro:
\badcode
mac*: SUBDIRS -= someclass