diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2022-07-27 19:06:39 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2022-09-01 19:44:19 +0200 |
commit | 8814fb5f4faff2d8442e481feb1bb35c2250e930 (patch) | |
tree | a498bb4b52202228934b5d9935d8fc6f1ba54122 /src/testlib | |
parent | 711105058afe68407a0ed613335a83b6181112ed (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.
Pick-to: 6.4
Change-Id: I247d08262302dcedb98ffbf301932d6dd84d7ff7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Diffstat (limited to 'src/testlib')
-rw-r--r-- | src/testlib/doc/src/qttest-best-practices.qdoc | 19 |
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 |