summaryrefslogtreecommitdiffstats
path: root/patches/0107-Only-run-JSC-benchmarks-if-access-to-the-source-code.patch
blob: ecbb8d31bc81aa7f07b724f268c95377667f13d3 (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 5a7fa545c9687c1dc3f2007a5f6686cc8353cfbb Mon Sep 17 00:00:00 2001
From: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
Date: Fri, 25 Mar 2011 13:32:54 -0500
Subject: [PATCH] Only run JSC benchmarks if access to the source code

When modularized, the benchmark test case might not have access
to the JavaScriptCore source code. So, make sure the test case
still compiles in this case.
---
 .../benchmarks/corelib/tools/qregexp/main.cpp      |   12 ++++++++----
 .../benchmarks/corelib/tools/qregexp/qregexp.pro   |    7 +++++--
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/qtbase/tests/benchmarks/corelib/tools/qregexp/main.cpp b/qtbase/tests/benchmarks/corelib/tools/qregexp/main.cpp
index 98d539f..74f9e63 100644
--- a/qtbase/tests/benchmarks/corelib/tools/qregexp/main.cpp
+++ b/qtbase/tests/benchmarks/corelib/tools/qregexp/main.cpp
@@ -49,9 +49,10 @@
 #include <boost/regex.hpp>
 #endif
 
+#ifdef HAVE_JSC
 #include <QtScript>
 #include "pcre/pcre.h"
-
+#endif
 #define ZLIB_VERSION "1.2.3.4"
 
 class tst_qregexp : public QObject
@@ -82,9 +83,11 @@ private slots:
     void rangeReplace2();
     void matchReplace2();
 
+#ifdef HAVE_JSC
     void simpleFindJSC();
     void rangeReplaceJSC();
     void matchReplaceJSC();
+#endif
 
 #ifdef HAVE_BOOST
     void simpleFindBoost();
@@ -100,8 +103,10 @@ private slots:
     void horribleReplace1();
     void horribleReplace2();
     void horribleWrongReplace2();
+#ifdef HAVE_JSC
     void horribleWrongReplaceJSC();
     void horribleReplaceJSC();
+#endif
 #ifdef HAVE_BOOST
     void horribleWrongReplaceBoost();
     void horribleReplaceBoost();
@@ -454,8 +459,7 @@ void tst_qregexp::horribleReplace2()
     }
     QCOMPARE(r, QString("1.2.3"));
 }
-
-
+#ifdef HAVE_JSC
 void tst_qregexp::simpleFindJSC()
 {
     int numr;
@@ -525,7 +529,7 @@ void tst_qregexp::horribleReplaceJSC()
     }
     QCOMPARE(r.toString(), QString("1.2.3"));
 }
-
+#endif
 
 #ifdef HAVE_BOOST
 void tst_qregexp::simpleFindBoost(){
diff --git a/qtbase/tests/benchmarks/corelib/tools/qregexp/qregexp.pro b/qtbase/tests/benchmarks/corelib/tools/qregexp/qregexp.pro
index ffdad12..5e53824a 100644
--- a/qtbase/tests/benchmarks/corelib/tools/qregexp/qregexp.pro
+++ b/qtbase/tests/benchmarks/corelib/tools/qregexp/qregexp.pro
@@ -5,14 +5,17 @@ DEPENDPATH += .
 INCLUDEPATH += .
 RESOURCES+=qregexp.qrc
 QT -= gui
-QT += script
 
 CONFIG += release
 
 # Input
 SOURCES += main.cpp
 
-include( $${QT_SOURCE_TREE}/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri )
+!isEmpty(QT.webkit.sources):exists($${QT.webkit.sources}/../JavaScriptCore/JavaScriptCore.pri) {
+    include( $${QT.webkit.sources}/../JavaScriptCore/JavaScriptCore.pri )
+    DEFINES += HAVE_JSC
+    QT += script
+}
 
 exists( /usr/include/boost/regex.hpp ){
 DEFINES+=HAVE_BOOST
-- 
1.7.2.3.msysgit.0.311.gb27be