diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2019-04-16 16:32:08 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2019-04-16 16:32:08 +0200 |
commit | 6630937e63ae5797487b86743a7733c8ae5cc42c (patch) | |
tree | 3d53dacf6430f9099e1fb20835881205de674961 /src/testlib/qtaptestlogger.cpp | |
parent | 37ed6dae00640f9cc980ffda05347c12a7eb5d7e (diff) | |
parent | c7af193d2e49e9f10b86262e63d8d13abf72b5cf (diff) |
Merge commit 'dev' into 'wip/cmake-merge'
Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
Diffstat (limited to 'src/testlib/qtaptestlogger.cpp')
-rw-r--r-- | src/testlib/qtaptestlogger.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/testlib/qtaptestlogger.cpp b/src/testlib/qtaptestlogger.cpp index 37ab89ac91..540b36e273 100644 --- a/src/testlib/qtaptestlogger.cpp +++ b/src/testlib/qtaptestlogger.cpp @@ -43,7 +43,9 @@ #include "qtestresult_p.h" #include "qtestassert.h" -#include <QtCore/qregularexpression.h> +#if QT_CONFIG(regularexpression) +# include <QtCore/qregularexpression.h> +#endif QT_BEGIN_NAMESPACE @@ -121,13 +123,15 @@ void QTapTestLogger::addIncident(IncidentTypes type, const char *description, return; } - bool ok = type == Pass || type == XPass || type == BlacklistedPass; + bool ok = type == Pass || type == XPass || type == BlacklistedPass || type == BlacklistedXPass; QTestCharBuffer directive; - if (type == XFail || type == XPass || type == BlacklistedFail || type == BlacklistedPass) + if (type == XFail || type == XPass || type == BlacklistedFail || type == BlacklistedPass + || type == BlacklistedXFail || type == BlacklistedXPass) { // We treat expected or blacklisted failures/passes as TODO-failures/passes, // which should be treated as soft issues by consumers. Not all do though :/ QTest::qt_asprintf(&directive, " # TODO %s", description); + } int testNumber = QTestLog::totalCount(); if (type == XFail) { @@ -146,6 +150,7 @@ void QTapTestLogger::addIncident(IncidentTypes type, const char *description, outputString(YAML_INDENT "---\n"); if (type != XFail) { +#if QT_CONFIG(regularexpression) // This is fragile, but unfortunately testlib doesn't plumb // the expected and actual values to the loggers (yet). static QRegularExpression verifyRegex( @@ -206,6 +211,12 @@ void QTapTestLogger::addIncident(IncidentTypes type, const char *description, YAML_INDENT "# %s\n", description); outputString(unparsableDescription.data()); } +#else + QTestCharBuffer unparsableDescription; + QTest::qt_asprintf(&unparsableDescription, + YAML_INDENT "# %s\n", description); + outputString(unparsableDescription.data()); +#endif } if (file) { |