summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestlog.cpp
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2014-05-12 23:16:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-15 02:51:06 +0200
commit4c14fa607fc61a35ba9c56c6b000190adcc80e75 (patch)
treee45e52637f73b0ee4a857534c1ce64cb1e7fff89 /src/testlib/qtestlog.cpp
parent77425eefec3e8fe944bc2361b18c97de112fed70 (diff)
Fix QtTestlib build under QT_NO_REGULAREXPRESSION
Change-Id: I4458226e814641269062990f272a40ca577bc9db Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/testlib/qtestlog.cpp')
-rw-r--r--src/testlib/qtestlog.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp
index 8cca892a4d..1e7f131652 100644
--- a/src/testlib/qtestlog.cpp
+++ b/src/testlib/qtestlog.cpp
@@ -133,7 +133,11 @@ namespace QTest {
return tp == type
&& (pattern.type() == QVariant::String ?
stringsMatch(pattern.toString(), message) :
+#ifndef QT_NO_REGULAREXPRESSION
pattern.toRegularExpression().match(message).hasMatch());
+#else
+ false);
+#endif
}
QtMsgType type;
@@ -359,7 +363,9 @@ void QTestLog::printUnhandledIgnoreMessages()
if (list->pattern.type() == QVariant::String) {
message = QStringLiteral("Did not receive message: \"") + list->pattern.toString() + QLatin1Char('"');
} else {
+#ifndef QT_NO_REGULAREXPRESSION
message = QStringLiteral("Did not receive any message matching: \"") + list->pattern.toRegularExpression().pattern() + QLatin1Char('"');
+#endif
}
QTest::TestLoggers::addMessage(QAbstractTestLogger::Info, message);
@@ -512,12 +518,14 @@ void QTestLog::ignoreMessage(QtMsgType type, const char *msg)
QTest::IgnoreResultList::append(QTest::ignoreResultList, type, QString::fromLocal8Bit(msg));
}
+#ifndef QT_NO_REGULAREXPRESSION
void QTestLog::ignoreMessage(QtMsgType type, const QRegularExpression &expression)
{
QTEST_ASSERT(expression.isValid());
QTest::IgnoreResultList::append(QTest::ignoreResultList, type, QVariant(expression));
}
+#endif // QT_NO_REGULAREXPRESSION
void QTestLog::setMaxWarnings(int m)
{