aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/parserstress
diff options
context:
space:
mode:
authorKurt Korbatits <kurt.korbatits@nokia.com>2012-03-06 14:01:34 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-07 06:24:18 +0100
commit65764c0334e92c7229457c1bc412f262c9ffdb8a (patch)
tree3c7b5dccd5ad6537f113b252077f6178de88c48f /tests/auto/qml/parserstress
parent2df64d04bee04b9a30d6d62582199cc9ec524632 (diff)
Changed qml tests to work from install directory
- Changed tests to use TESTDATA - moved qqmlcontext to private test as it contains private header - added check for cross_compile option to skip when sources not available Change-Id: I0f68f58ffcb1b41b8e40a9851e3e003fe72ee2f9 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'tests/auto/qml/parserstress')
-rw-r--r--tests/auto/qml/parserstress/parserstress.pro3
-rw-r--r--tests/auto/qml/parserstress/tst_parserstress.cpp12
2 files changed, 8 insertions, 7 deletions
diff --git a/tests/auto/qml/parserstress/parserstress.pro b/tests/auto/qml/parserstress/parserstress.pro
index 3cf3e02e4e..6885de3065 100644
--- a/tests/auto/qml/parserstress/parserstress.pro
+++ b/tests/auto/qml/parserstress/parserstress.pro
@@ -4,8 +4,7 @@ macx:CONFIG -= app_bundle
SOURCES += tst_parserstress.cpp
-DEFINES += SRCDIR=\\\"$$PWD\\\"
-DEFINES += TESTDATADIR=\\\"$$PWD/tests\\\"
+TESTDATA = tests/*
CONFIG += parallel_test
diff --git a/tests/auto/qml/parserstress/tst_parserstress.cpp b/tests/auto/qml/parserstress/tst_parserstress.cpp
index c7f4840a11..a179a24f5f 100644
--- a/tests/auto/qml/parserstress/tst_parserstress.cpp
+++ b/tests/auto/qml/parserstress/tst_parserstress.cpp
@@ -86,15 +86,16 @@ QStringList tst_parserstress::findJSFiles(const QDir &d)
void tst_parserstress::ecmascript_data()
{
-#ifdef TESTDATADIR
- QDir dir(TESTDATADIR);
+ QString testDataDir = QFileInfo(QFINDTESTDATA("tests/shell.js")).absolutePath();
+ QVERIFY2(!testDataDir.isEmpty(), qPrintable("Cannot find testDataDir!"));
+
+ QDir dir(testDataDir);
QStringList files = findJSFiles(dir);
QTest::addColumn<QString>("file");
foreach (const QString &file, files) {
QTest::newRow(qPrintable(file)) << file;
}
-#endif
}
void tst_parserstress::ecmascript()
@@ -126,8 +127,9 @@ void tst_parserstress::ecmascript()
QByteArray qmlData = qml.toUtf8();
QQmlComponent component(&engine);
-
- component.setData(qmlData, QUrl::fromLocalFile(SRCDIR + QString("/dummy.qml")));
+
+ QString dummyFile = QFINDTESTDATA("dummy.qml");
+ component.setData(qmlData, QUrl::fromLocalFile(dummyFile));
QFileInfo info(file);