From 65764c0334e92c7229457c1bc412f262c9ffdb8a Mon Sep 17 00:00:00 2001 From: Kurt Korbatits Date: Tue, 6 Mar 2012 14:01:34 +1000 Subject: 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 Reviewed-by: Michael Brasser --- tests/auto/qml/parserstress/tst_parserstress.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tests/auto/qml/parserstress/tst_parserstress.cpp') 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("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); -- cgit v1.2.3