summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-07-28 10:32:11 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-07-29 18:46:39 +0200
commit7c14223b1e21a3e19a0f84c772c0c8ca49dfe74f (patch)
tree0074da99965579a4c26894f7eb1a63b18111ec41 /src/tools
parentcba2adb1952db08202e3c7a633cfa3f62575fb99 (diff)
testlib: Update a few remaining instances of the deprecated -xunitxml format
The format was renamed in 27db9e458cef512fca3a6b5c9ebbcda7a8172428. Pick-to: 6.2 Change-Id: I53975c7467d8768dc9dc9ac2d89c42eefa12e22f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/androidtestrunner/main.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/tools/androidtestrunner/main.cpp b/src/tools/androidtestrunner/main.cpp
index e0a69bb9cb..200cf5a5ed 100644
--- a/src/tools/androidtestrunner/main.cpp
+++ b/src/tools/androidtestrunner/main.cpp
@@ -47,6 +47,18 @@
#define QT_POPEN_READ "r"
#endif
+static auto junitChecker = [](const QByteArray &data) -> bool {
+ QXmlStreamReader reader{data};
+ while (!reader.atEnd()) {
+ reader.readNext();
+ if (reader.isStartElement() && reader.name() == QStringLiteral("testcase") &&
+ reader.attributes().value(QStringLiteral("result")).toString() == QStringLiteral("fail")) {
+ return false;
+ }
+ }
+ return true;
+};
+
struct Options
{
bool helpRequested = false;
@@ -84,17 +96,8 @@ struct Options
{QStringLiteral("lightxml"), [](const QByteArray &data) -> bool {
return data.indexOf("\n<Incident type=\"fail\" ") < 0;
}},
- {QStringLiteral("xunitxml"), [](const QByteArray &data) -> bool {
- QXmlStreamReader reader{data};
- while (!reader.atEnd()) {
- reader.readNext();
- if (reader.isStartElement() && reader.name() == QStringLiteral("testcase") &&
- reader.attributes().value(QStringLiteral("result")).toString() == QStringLiteral("fail")) {
- return false;
- }
- }
- return true;
- }},
+ {QStringLiteral("xunitxml"), junitChecker},
+ {QStringLiteral("junitxml"), junitChecker},
{QStringLiteral("teamcity"), [](const QByteArray &data) -> bool {
return data.indexOf("' message='Failure! |[Loc: ") < 0;
}},
@@ -335,8 +338,8 @@ static void setOutputFile(QString file, QString format)
static bool parseTestArgs()
{
- QRegularExpression oldFormats{QStringLiteral("^-(txt|csv|xunitxml|xml|lightxml|teamcity|tap)$")};
- QRegularExpression newLoggingFormat{QStringLiteral("^(.*),(txt|csv|xunitxml|xml|lightxml|teamcity|tap)$")};
+ QRegularExpression oldFormats{QStringLiteral("^-(txt|csv|xunitxml|junitxml|xml|lightxml|teamcity|tap)$")};
+ QRegularExpression newLoggingFormat{QStringLiteral("^(.*),(txt|csv|xunitxml|junitxml|xml|lightxml|teamcity|tap)$")};
QString file;
QString logType;