diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2019-06-04 12:07:20 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2019-06-04 10:14:39 +0000 |
commit | 5c954b89a9bd94b085a49d05dfa25644b2eda1c8 (patch) | |
tree | 4f7a392af74a9db67167a118c351c35f77cac330 /tests/auto/testlib/selftests/failinit/CMakeLists.txt | |
parent | fae5691c7f78f8a0154c9cea28b6639327a90550 (diff) |
Fix qFindTestData with cmake and ninja generator
In order for test lib to locate the file requested via QFINDTESTDATA, it
needs the build directory of the test (for example
$builddir/tests/auto/foo/bar) and __FILE__ expanding to a path to the
source relative to this build directory.
With ninja, __FILE__ is a path that is always relative to the top-level
build directory, not the per-test case one. Therefore the path
resolution in testlib fails.
To accommodate this, add_qt_test() now always sets QT_TESTCASE_BUILDDIR
as well as the newly introduced QT_TESTCASE_SOURCEDIR, which, as an
absolute path, removes the need to use __FILE__.
Change-Id: I16c2b0001e38162e6da9fdb1a61f4f8ce634fe46
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Diffstat (limited to 'tests/auto/testlib/selftests/failinit/CMakeLists.txt')
0 files changed, 0 insertions, 0 deletions