diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2021-03-24 12:58:08 +0100 |
---|---|---|
committer | Alexey Edelev <alexey.edelev@qt.io> | 2021-04-08 13:16:41 +0200 |
commit | 70464b355ec1c7007e0b1291f733e2540ba1825f (patch) | |
tree | 36113b6e6c9fa80804c7a34c2d3cb90e7956cbb4 /src/testlib/qtestcase.qdoc | |
parent | 1999e2adc12a66488b241ff0e00c8716bd217c0a (diff) |
Specify QT_TESTCASE_BUILDDIR for Qt::Test users implicitly
QT_TESTCASE_BUILDDIR was implicitly defined by Qt::Test target for
library users in Qt5. By default, this definition will point to
CMAKE_CURRENT_BINARY_DIR. This logic works similarly to qmake logic.
From user's perspective it might be useful to not rely on standard
search paths, but specify own. This can be done by setting the
QT_TESTCASE_BUILDDIR property for the user's target. CMake will
substute the value of the QT_TESTCASE_BUILDDIR property into the
QT_TESTCASE_BUILDDIR definition.
The implicit QT_TESTCASE_SOURCEDIR also seems to be useful. According
to the current logic, it points to CMAKE_CURRENT_SOURCE_DIR.
Fixes: QTBUG-92079
Change-Id: I8a9065f08e859c713b3c8cc08142a9ced0677770
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/testlib/qtestcase.qdoc')
-rw-r--r-- | src/testlib/qtestcase.qdoc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/testlib/qtestcase.qdoc b/src/testlib/qtestcase.qdoc index 08f111b43e..2a480fb349 100644 --- a/src/testlib/qtestcase.qdoc +++ b/src/testlib/qtestcase.qdoc @@ -522,6 +522,10 @@ absolute paths to the source files are passed to the compiler. Otherwise, the absolute path of the source directory cannot be determined. + \note The \c{QT_TESTCASE_BUILDDIR} macro is also implicitly defined if CMake is used + and the QtTest module is linked to the target. You can change the default + \c{QT_TESTCASE_BUILDDIR} by setting the QT_TESTCASE_BUILDDIR property on the target. + \note For tests that use the \l QTEST_APPLESS_MAIN() macro to generate a \c{main()} function, \c{QFINDTESTDATA} will not attempt to find test data relative to QCoreApplication::applicationDirPath(). In practice, this means that |