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.
This commit is contained in:
parent
57e47f1c7e
commit
0389278105
@ -49,9 +49,10 @@
|
|||||||
#include <boost/regex.hpp>
|
#include <boost/regex.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_JSC
|
||||||
#include <QtScript>
|
#include <QtScript>
|
||||||
#include "pcre/pcre.h"
|
#include "pcre/pcre.h"
|
||||||
|
#endif
|
||||||
#define ZLIB_VERSION "1.2.3.4"
|
#define ZLIB_VERSION "1.2.3.4"
|
||||||
|
|
||||||
class tst_qregexp : public QObject
|
class tst_qregexp : public QObject
|
||||||
@ -82,9 +83,11 @@ private slots:
|
|||||||
void rangeReplace2();
|
void rangeReplace2();
|
||||||
void matchReplace2();
|
void matchReplace2();
|
||||||
|
|
||||||
|
#ifdef HAVE_JSC
|
||||||
void simpleFindJSC();
|
void simpleFindJSC();
|
||||||
void rangeReplaceJSC();
|
void rangeReplaceJSC();
|
||||||
void matchReplaceJSC();
|
void matchReplaceJSC();
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_BOOST
|
#ifdef HAVE_BOOST
|
||||||
void simpleFindBoost();
|
void simpleFindBoost();
|
||||||
@ -100,8 +103,10 @@ private slots:
|
|||||||
void horribleReplace1();
|
void horribleReplace1();
|
||||||
void horribleReplace2();
|
void horribleReplace2();
|
||||||
void horribleWrongReplace2();
|
void horribleWrongReplace2();
|
||||||
|
#ifdef HAVE_JSC
|
||||||
void horribleWrongReplaceJSC();
|
void horribleWrongReplaceJSC();
|
||||||
void horribleReplaceJSC();
|
void horribleReplaceJSC();
|
||||||
|
#endif
|
||||||
#ifdef HAVE_BOOST
|
#ifdef HAVE_BOOST
|
||||||
void horribleWrongReplaceBoost();
|
void horribleWrongReplaceBoost();
|
||||||
void horribleReplaceBoost();
|
void horribleReplaceBoost();
|
||||||
@ -454,8 +459,7 @@ void tst_qregexp::horribleReplace2()
|
|||||||
}
|
}
|
||||||
QCOMPARE(r, QString("1.2.3"));
|
QCOMPARE(r, QString("1.2.3"));
|
||||||
}
|
}
|
||||||
|
#ifdef HAVE_JSC
|
||||||
|
|
||||||
void tst_qregexp::simpleFindJSC()
|
void tst_qregexp::simpleFindJSC()
|
||||||
{
|
{
|
||||||
int numr;
|
int numr;
|
||||||
@ -525,7 +529,7 @@ void tst_qregexp::horribleReplaceJSC()
|
|||||||
}
|
}
|
||||||
QCOMPARE(r.toString(), QString("1.2.3"));
|
QCOMPARE(r.toString(), QString("1.2.3"));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_BOOST
|
#ifdef HAVE_BOOST
|
||||||
void tst_qregexp::simpleFindBoost(){
|
void tst_qregexp::simpleFindBoost(){
|
||||||
|
@ -5,14 +5,17 @@ DEPENDPATH += .
|
|||||||
INCLUDEPATH += .
|
INCLUDEPATH += .
|
||||||
RESOURCES+=qregexp.qrc
|
RESOURCES+=qregexp.qrc
|
||||||
QT -= gui
|
QT -= gui
|
||||||
QT += script
|
|
||||||
|
|
||||||
CONFIG += release
|
CONFIG += release
|
||||||
|
|
||||||
# Input
|
# Input
|
||||||
SOURCES += main.cpp
|
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 ){
|
exists( /usr/include/boost/regex.hpp ){
|
||||||
DEFINES+=HAVE_BOOST
|
DEFINES+=HAVE_BOOST
|
||||||
|
Loading…
x
Reference in New Issue
Block a user