summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-06-30 22:59:21 +0200
committerLiang Qi <liang.qi@qt.io>2018-07-02 11:23:45 +0200
commite3ed2281c0c891cf3b15c95f9f7cdae42e9f233a (patch)
treeaae8da6ce616eae02b69fb1fcdcb4383c8fe6811 /tests/auto/testlib
parent3be141d5bc199080b524d8f6f5ce514e8f74d23a (diff)
parente75e4b39b78ba05ea2cd45dc96acf99fc89c5915 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts: src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/cocoa/qnsview_dragging.mm src/plugins/platforms/ios/qiosinputcontext.mm src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/tools/androiddeployqt/main.cpp Was moved from qttools into qtbase in 5.11. So re-apply 32398e4d here. tests/auto/corelib/global/qlogging/test/test.pro tests/auto/corelib/global/qlogging/tst_qlogging.cpp tests/auto/corelib/io/qfile/tst_qfile.cpp tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp tests/auto/corelib/thread/qthreadstorage/test/test.pro tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp tests/auto/widgets/kernel/qapplication/test/test.pro Done-with: Gatis Paeglis <gatis.paeglis@qt.io> Done-with: MÃ¥rten Nordheim <marten.nordheim@qt.io> Done-with: Oliver Wolff <oliver.wolff@qt.io> Change-Id: Id970486c5315a1718c540f00deb2633533e8fc7b
Diffstat (limited to 'tests/auto/testlib')
-rw-r--r--tests/auto/testlib/selftests/findtestdata/findtestdata.cpp24
-rw-r--r--tests/auto/testlib/selftests/test/test.pro2
2 files changed, 25 insertions, 1 deletions
diff --git a/tests/auto/testlib/selftests/findtestdata/findtestdata.cpp b/tests/auto/testlib/selftests/findtestdata/findtestdata.cpp
index a775bc1ee5..7d5857faa0 100644
--- a/tests/auto/testlib/selftests/findtestdata/findtestdata.cpp
+++ b/tests/auto/testlib/selftests/findtestdata/findtestdata.cpp
@@ -134,6 +134,30 @@ void FindTestData::paths()
#endif
QVERIFY(QFile(testfile_path3).remove());
+#if !defined(Q_OS_WIN)
+ struct ChdirOnReturn
+ {
+ ~ChdirOnReturn() { QDir::setCurrent(dir); }
+ QString dir;
+ };
+
+ // When cross-compiling from Windows to a *nix system the __FILE__ path's canonical path is an
+ // empty string, which, when used as a prefix, would cause QFINDTESTDATA to look for files in
+ // root ('/') when trying to look for files relative to the test source.
+ QString usrPath = app_path + "/temp/usr/";
+ QVERIFY(QDir().mkpath(usrPath));
+ {
+ ChdirOnReturn chdirObject{QDir::currentPath()};
+ QDir::setCurrent(app_path + "/temp");
+ QCOMPARE(QTest::qFindTestData("usr/",
+ "C:\\path\\to\\source\\source.cpp",
+ __LINE__,
+ "C:\\path\\to\\build\\").toLower(),
+ usrPath.toLower());
+ }
+ QVERIFY(QDir().rmpath(usrPath));
+#endif
+
// Note, this is expected to generate a warning.
// We can't use ignoreMessage, because the warning comes from testlib,
// not via a "normal" qWarning. But it's OK, our caller (tst_selftests)
diff --git a/tests/auto/testlib/selftests/test/test.pro b/tests/auto/testlib/selftests/test/test.pro
index a348ea9ad5..ec1633ebff 100644
--- a/tests/auto/testlib/selftests/test/test.pro
+++ b/tests/auto/testlib/selftests/test/test.pro
@@ -17,5 +17,5 @@ expected_files.base = $$PWD/..
RESOURCES += expected_files
include(../selftests.pri)
-!winrt: for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../$${file}/$${file}"
+!android:!winrt: for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../$${file}/$${file}"