summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qfile
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-07-04 15:19:36 +0200
committerLiang Qi <liang.qi@qt.io>2017-07-04 16:05:53 +0200
commitc2b224a758ce7e6dcf3748444fa8e29ab81904be (patch)
tree277cb99bf054190c935579142506caa4ec9861dd /tests/auto/corelib/io/qfile
parent10de063ff12cdba07b4620182aced8ed05ee3505 (diff)
parenteaee1209f0ead5be786e81db8aee604ccfea85b0 (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: src/corelib/io/qprocess_unix.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/widgets/util/util.pri tests/auto/corelib/thread/qthread/qthread.pro tests/auto/corelib/thread/qthread/tst_qthread.cpp Change-Id: I5c45ab54d46d3c75a5c6c116777ebf5bc47a871b
Diffstat (limited to 'tests/auto/corelib/io/qfile')
-rw-r--r--tests/auto/corelib/io/qfile/test/test.pro6
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp10
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qfile/test/test.pro b/tests/auto/corelib/io/qfile/test/test.pro
index 7ad047e8a2..1472ddbb83 100644
--- a/tests/auto/corelib/io/qfile/test/test.pro
+++ b/tests/auto/corelib/io/qfile/test/test.pro
@@ -4,6 +4,12 @@ QT = core-private core testlib
qtHaveModule(network): QT += network
else: DEFINES += QT_NO_NETWORK
+contains(CONFIG, builtin_testdata) {
+ DEFINES += BUILTIN_TESTDATA
+}
+
+TESTDATA += ../BLACKLIST
+
TARGET = ../tst_qfile
SOURCES = ../tst_qfile.cpp
INCLUDEPATH += ../../../../../shared/
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index f97501e8a6..17497e46b9 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -250,6 +250,9 @@ private slots:
void reuseQFile();
private:
+#ifdef BUILTIN_TESTDATA
+ QSharedPointer<QTemporaryDir> m_dataDir;
+#endif
enum FileType {
OpenQFile,
OpenFd,
@@ -428,8 +431,15 @@ void tst_QFile::initTestCase()
QVERIFY(!m_forRenamingFile.isEmpty());
m_twoDotsFile = QFINDTESTDATA("two.dots.file");
QVERIFY(!m_twoDotsFile.isEmpty());
+
+#ifndef BUILTIN_TESTDATA
m_testFile = QFINDTESTDATA("testfile.txt");
QVERIFY(!m_testFile.isEmpty());
+#else
+ m_dataDir = QEXTRACTTESTDATA("/");
+ QVERIFY2(!m_dataDir.isNull(), qPrintable("Could not extract test data"));
+ m_testFile = m_dataDir->path() + "/testfile.txt";
+#endif
m_resourcesDir = QFINDTESTDATA("resources");
QVERIFY(!m_resourcesDir.isEmpty());
m_noEndOfLineFile = QFINDTESTDATA("noendofline.txt");