Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.1.0 Beta2
-
-
70464b355ec1c7007e0b1291f733e2540ba1825f (qt/qtbase/dev)
Description
With a test in {srcdir}/autotests and a data file in {srcdir}/autotests/data/testfile QFINDTESTDATA("data/testfile") fails to find the file with Qt6 but works fine in Qt 5.15.
The issue boils down to the fact that QT_TESTCASE_BUILDDIR is not defined when building against Qt6.
In Qt5 the following code would have it defined:
find_package(Qt5 REQUIRED COMPONENTS Core Test)add_executable(foo main.cpp) target_link_libraries(foo PRIVATE Qt::Core Qt::Test)
This is done in Qt5TestConfigExtras.cmake
However this is not the case when building against Qt6. There QT_TESTCASE_BUILDDIR is only defined in QtTestHelpers.cmake which does not seem to be public
Attachments
Issue Links
- relates to
-
QTBUG-117098 qt_internal_add_test's non builtin_testdata mode can't be relied upon for QFINDTESTDATA
- Reported