QT_SKIP_DEFAULT_TESTCASE_DIRS

This variable was introduced in Qt 6.9.

注意: This variable is in technology preview and may change in future releases.

Disables the test case directory definitions for the Qt Test targets.

Controls the default value of the QT_SKIP_DEFAULT_TESTCASE_DIRS target property.

注意: Supported by CMake versions >= 3.23.

set(QT_SKIP_DEFAULT_TESTCASE_DIRS TRUE)
...
qt_add_executable(mytest1 main1.cpp)
target_link_libraries(mytest1 PRIVATE Qt6::Test)
...
qt_add_executable(mytest2 main2.cpp)
target_link_libraries(mytest2 PRIVATE Qt6::Test)
					

The QT_TESTCASE_SOURCEDIR and QT_TESTCASE_BUILDDIR macros will remain undefined when compiling mytest1 and mytest2 .

另请参阅 QFINDTESTDATA and QT_SKIP_DEFAULT_TESTCASE_DIRS .