summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorMaurice Kalinowski <maurice.kalinowski@theqtcompany.com>2016-02-16 08:50:55 +0100
committerMaurice Kalinowski <maurice.kalinowski@theqtcompany.com>2016-02-17 04:50:14 +0000
commit8b0dc802943358d0245a343533f0ffb1a55c6f76 (patch)
tree4a5eb03488bbbe034821bb5429e18601a1a75199 /tests/auto
parent6c7c34f219b6d156428d3fae79a09a2c68814ce6 (diff)
winrt: Fix usage of testdata
testdata needs to be deployed to temp and current directory needs to be set to that directory for the test to succeed. Change-Id: I2dd023af9073d90afbb4ad60fcfb50bb1af4e159 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp
index 2707b6df41..c2290add5b 100644
--- a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp
+++ b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp
@@ -58,6 +58,7 @@ private slots:
private:
int languageChangeEventCounter;
+ QSharedPointer<QTemporaryDir> dataDir;
};
tst_QTranslator::tst_QTranslator()
@@ -90,8 +91,16 @@ void tst_QTranslator::initTestCase()
// chdir into the directory containing our testdata,
// to make the code simpler (load testdata via relative paths)
+#ifdef Q_OS_WINRT
+ // ### TODO: Use this for all platforms in 5.7
+ dataDir = QEXTRACTTESTDATA(QStringLiteral("/"));
+ QVERIFY2(!dataDir.isNull(), qPrintable("Could not extract test data"));
+ QVERIFY2(QDir::setCurrent(dataDir->path()), qPrintable("Could not chdir to " + dataDir->path()));
+#else // !Q_OS_WINRT
QString testdata_dir = QFileInfo(QFINDTESTDATA("hellotr_la.qm")).absolutePath();
QVERIFY2(QDir::setCurrent(testdata_dir), qPrintable("Could not chdir to " + testdata_dir));
+#endif // !Q_OS_WINRT
+
}
bool tst_QTranslator::eventFilter(QObject *, QEvent *event)