summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt CI Bot <qt_ci_bot@qt-project.org>2021-04-08 16:21:16 +0000
committerQt CI Bot <qt_ci_bot@qt-project.org>2021-04-08 16:21:16 +0000
commit9690e7bdd34f2298bf4668a31345cfafbf535177 (patch)
tree45f95f19a323db960a2a2631ba993615cbc7d347 /src
parent5c969aeab17b9c0668e2d1d19ccbfc94df3b05dd (diff)
parent70464b355ec1c7007e0b1291f733e2540ba1825f (diff)
Merge integration refs/builds/qtci/dev/1617880670
Diffstat (limited to 'src')
-rw-r--r--src/testlib/CMakeLists.txt10
-rw-r--r--src/testlib/qtestcase.qdoc4
2 files changed, 14 insertions, 0 deletions
diff --git a/src/testlib/CMakeLists.txt b/src/testlib/CMakeLists.txt
index a2307045e7..da53bb8b68 100644
--- a/src/testlib/CMakeLists.txt
+++ b/src/testlib/CMakeLists.txt
@@ -110,6 +110,16 @@ qt_internal_extend_target(Test CONDITION MACOS
${FWIOKit}
)
+set(qt_tc_build_dir "$<TARGET_PROPERTY:QT_TESTCASE_BUILDDIR>")
+set(qt_bool_tc_build_dir "$<BOOL:${qt_tc_build_dir}>")
+set(qt_tc_build_dir_def
+ "$<IF:${qt_bool_tc_build_dir},${qt_tc_build_dir},$<TARGET_PROPERTY:BINARY_DIR>>"
+)
+set_property(TARGET Test PROPERTY INTERFACE_COMPILE_DEFINITIONS
+ QT_TESTCASE_BUILDDIR="${qt_tc_build_dir_def}"
+ QT_TESTCASE_SOURCEDIR="$<TARGET_PROPERTY:SOURCE_DIR>"
+)
+
# special case begin
# Do not bother with disabled stuff:
# qt_internal_extend_target(Test CONDITION (MACOS) AND (OFF AND NOT lessThan(QMAKE_XCODE_VERSION, "6.0")) ...
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