summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks
diff options
context:
space:
mode:
authorMarius Storm-Olsen <marius.storm-olsen@nokia.com>2011-03-25 13:32:54 -0500
committeraxis <qt-info@nokia.com>2011-04-27 12:06:04 +0200
commit0389278105da8b364cac6e4a6f75c3148e00d24b (patch)
treee9d322b8d66e62aa0fd5d6f3f17f3349892b0bf7 /tests/benchmarks
parent57e47f1c7e2b34a0db739ac3a0fa87f207179498 (diff)
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.
Diffstat (limited to 'tests/benchmarks')
-rw-r--r--tests/benchmarks/corelib/tools/qregexp/main.cpp12
-rw-r--r--tests/benchmarks/corelib/tools/qregexp/qregexp.pro7
2 files changed, 13 insertions, 6 deletions
diff --git a/tests/benchmarks/corelib/tools/qregexp/main.cpp b/tests/benchmarks/corelib/tools/qregexp/main.cpp
index 98d539f21a..74f9e63ace 100644
--- a/tests/benchmarks/corelib/tools/qregexp/main.cpp
+++ b/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/tests/benchmarks/corelib/tools/qregexp/qregexp.pro b/tests/benchmarks/corelib/tools/qregexp/qregexp.pro
index ffdad12cef..5e53824a96 100644
--- a/tests/benchmarks/corelib/tools/qregexp/qregexp.pro
+++ b/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