diff options
Diffstat (limited to 'tests/auto/qml/parserstress')
-rw-r--r-- | tests/auto/qml/parserstress/parserstress.pro | 3 | ||||
-rw-r--r-- | tests/auto/qml/parserstress/tst_parserstress.cpp | 12 |
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); |