diff options
author | Kurt Korbatits <kurt.korbatits@nokia.com> | 2012-03-06 14:01:34 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-07 06:24:18 +0100 |
commit | 65764c0334e92c7229457c1bc412f262c9ffdb8a (patch) | |
tree | 3c7b5dccd5ad6537f113b252077f6178de88c48f /tests/auto/qml/parserstress/tst_parserstress.cpp | |
parent | 2df64d04bee04b9a30d6d62582199cc9ec524632 (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/tst_parserstress.cpp')
-rw-r--r-- | tests/auto/qml/parserstress/tst_parserstress.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
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); |