summaryrefslogtreecommitdiffstats
path: root/patches/0095-Fixed-parserstress-test.patch
blob: 6148f177bc5177188129e6fadfb33722d4f60a16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
From 7958990058dfc22143f9246b6ec785cc0d49d0df Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Mon, 21 Mar 2011 12:55:15 +0100
Subject: [PATCH] Fixed parserstress test.

---
 .../auto/declarative/parserstress/parserstress.pro |   17 ++++++++++-----
 .../declarative/parserstress/tst_parserstress.cpp  |   22 +++++++------------
 2 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/qtdeclarative/tests/auto/declarative/parserstress/parserstress.pro b/qtdeclarative/tests/auto/declarative/parserstress/parserstress.pro
index 6ef2432..cbc5e18 100644
--- a/qtdeclarative/tests/auto/declarative/parserstress/parserstress.pro
+++ b/qtdeclarative/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/qtdeclarative/tests/auto/declarative/parserstress/tst_parserstress.cpp b/qtdeclarative/tests/auto/declarative/parserstress/tst_parserstress.cpp
index c0a01df..19ff25a 100644
--- a/qtdeclarative/tests/auto/declarative/parserstress/tst_parserstress.cpp
+++ b/qtdeclarative/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
 }
 
 
-- 
1.7.3.4