Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed parserstress test.
  • Loading branch information
axis committed Apr 27, 2011
1 parent 74d6346 commit 5f386fd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
17 changes: 11 additions & 6 deletions tests/auto/declarative/parserstress/parserstress.pro
Expand Up @@ -4,12 +4,17 @@ macx:CONFIG -= app_bundle

SOURCES += tst_parserstress.cpp

symbian: {
importFiles.files = ..\\..\\qscriptjstestsuite\\tests
importFiles.path = .
DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
!isEmpty(QT.script.sources) {
symbian: {
importFiles.files = $$QT.script.sources\\..\\..\\tests\\auto\\qscriptjstestsuite\\tests
importFiles.path = .
DEPLOYMENT += importFiles
DEFINES += TESTDATADIR=tests
DEFINES += SRCDIR=.
} else {
DEFINES += TESTDATADIR=\\\"$$QT.script.sources/../../tests/auto/qscriptjstestsuite/tests\\\"
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
}

CONFIG += parallel_test
Expand Down
22 changes: 8 additions & 14 deletions tests/auto/declarative/parserstress/tst_parserstress.cpp
Expand Up @@ -46,11 +46,6 @@
#include <QDir>
#include <QFile>

#ifdef Q_OS_SYMBIAN
// In Symbian OS test data is located in applications private dir
#define SRCDIR "."
#endif

class tst_parserstress : public QObject
{
Q_OBJECT
Expand Down Expand Up @@ -91,25 +86,23 @@ QStringList tst_parserstress::findJSFiles(const QDir &d)

void tst_parserstress::ecmascript_data()
{
#ifdef Q_OS_SYMBIAN
QDir dir("tests");
#else
QDir dir(SRCDIR);
dir.cdUp();
dir.cdUp();
dir.cd("qscriptjstestsuite");
dir.cd("tests");
#endif
#ifdef 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()
{
#ifndef TESTDATADIR
QSKIP("Needs QtScript sources", SkipAll);
#else

QFETCH(QString, file);

QFile f(file);
Expand Down Expand Up @@ -157,6 +150,7 @@ void tst_parserstress::ecmascript()

QVERIFY(!component.isError());
}
#endif // ifdef TESTDATADIR
}


Expand Down

0 comments on commit 5f386fd

Please sign in to comment.