QT_SKIP_DEFAULT_TESTCASE_DIRS

This property was introduced in Qt 6.9.

Note: This property is in technology preview and may change in future releases.

The property disables the following compile-time definitions for the target:

  • QT_TESTCASE_SOURCEDIR
  • QT_TESTCASE_BUILDDIR

By default, these definitions point to the source and build directories of the target. Since they are only defined for this target, they preclude sharing precompiled headers with the compilation of other targets. If QT_SKIP_DEFAULT_TESTCASE_DIRS is set to TRUE these definitions are omitted, avoiding this limitation.

qt_add_executable(mytest main.cpp)
set_property(TARGET mytest PROPERTY QT_SKIP_DEFAULT_TESTCASE_DIRS TRUE)
target_link_libraries(mytest PRIVATE Qt6::Test)

The QT_TESTCASE_SOURCEDIR and QT_TESTCASE_BUILDDIR macros will remain undefined when compiling mytest.

The value of the property defaults to the value of the QT_SKIP_DEFAULT_TESTCASE_DIRS variable.

See also QFINDTESTDATA and QT_SKIP_DEFAULT_TESTCASE_DIRS.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.