aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2011-03-21 12:55:15 +0100
committeraxis <qt-info@nokia.com>2011-04-27 12:06:02 +0200
commit5f386fd581a896b66c9c969ec2ee64a476a998bb (patch)
tree0d0af36b1200853e7415a58d38836833ae220411
parent74d634606d80045c90a80de285cf4a731dc06fb4 (diff)
Fixed parserstress test.
-rw-r--r--tests/auto/declarative/parserstress/parserstress.pro17
-rw-r--r--tests/auto/declarative/parserstress/tst_parserstress.cpp22
2 files changed, 19 insertions, 20 deletions
diff --git a/tests/auto/declarative/parserstress/parserstress.pro b/tests/auto/declarative/parserstress/parserstress.pro
index 6ef2432b5b..cbc5e18181 100644
--- a/tests/auto/declarative/parserstress/parserstress.pro
+++ b/tests/auto/declarative/parserstress/parserstress.pro
@@ -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
diff --git a/tests/auto/declarative/parserstress/tst_parserstress.cpp b/tests/auto/declarative/parserstress/tst_parserstress.cpp
index c0a01df7c4..19ff25a814 100644
--- a/tests/auto/declarative/parserstress/tst_parserstress.cpp
+++ b/tests/auto/declarative/parserstress/tst_parserstress.cpp
@@ -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
@@ -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);
@@ -157,6 +150,7 @@ void tst_parserstress::ecmascript()
QVERIFY(!component.isError());
}
+#endif // ifdef TESTDATADIR
}