summaryrefslogtreecommitdiffstats
path: root/tests/auto/xmlpatternsxslts
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2011-12-21 16:54:05 +0100
committerQt by Nokia <qt-info@nokia.com>2011-12-22 10:50:32 +0100
commitd8370adf6bed002f53692f36db8e47f3a8fb7555 (patch)
tree7984c400d6cf62a52cc422e6d32b63125846dbea /tests/auto/xmlpatternsxslts
parentbfac7b0e29198e537a57991b517080fe4ac5f23f (diff)
QtXmlPatterns-test: Use QFINDTESTDATA to locate test data.
Introduce QFINDTESTDATA and set the current directory of the process to the test directory such that it works indepently of the working directory of executable location. Change-Id: I8105ba0fa7d9da7ff920d10f3a083433e2590e9f Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
Diffstat (limited to 'tests/auto/xmlpatternsxslts')
-rw-r--r--tests/auto/xmlpatternsxslts/tst_xmlpatternsxslts.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/auto/xmlpatternsxslts/tst_xmlpatternsxslts.cpp b/tests/auto/xmlpatternsxslts/tst_xmlpatternsxslts.cpp
index 6c21f980..cf2ac7c8 100644
--- a/tests/auto/xmlpatternsxslts/tst_xmlpatternsxslts.cpp
+++ b/tests/auto/xmlpatternsxslts/tst_xmlpatternsxslts.cpp
@@ -41,6 +41,8 @@
#include <QtTest/QtTest>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
#include "tst_suitetest.h"
@@ -65,7 +67,13 @@ tst_XmlPatternsXSLTS::tst_XmlPatternsXSLTS() : tst_SuiteTest(tst_SuiteTest::Xslt
void tst_XmlPatternsXSLTS::catalogPath(QString &write) const
{
- write = QLatin1String("XSLTS/catalogResolved.xml");
+ const char testSuite[] = "XSLTS";
+ const QString testSuitePath = QFINDTESTDATA(testSuite);
+ if (!testSuitePath.isEmpty()) {
+ const QString testDirectory = QFileInfo(testSuitePath).absolutePath();
+ QVERIFY2(QDir::setCurrent(testDirectory), qPrintable(QStringLiteral("Could not chdir to ") + testDirectory));
+ write = QLatin1String(testSuite) + QStringLiteral("/catalogResolved.xml");
+ }
}
QTEST_MAIN(tst_XmlPatternsXSLTS)