AutoTest: Fix displaying XML content

CDATA sections that have line breaks at their line ends
within a multiline CDATA section should get handled
that these (inner) line breaks do not get lost.
This patch fixes displaying failed Qt tests when using
the XML output.

Change-Id: I3aa7100836613372ac5b2b409c5cfacfb34209ba
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2018-11-05 15:58:27 +01:00
parent 2cf2cebfc9
commit 3056105c66
7 changed files with 28 additions and 18 deletions

View File

@@ -62,7 +62,7 @@ GTestOutputReader::GTestOutputReader(const QFutureInterface<TestResultPtr> &futu
}
}
void GTestOutputReader::processOutput(const QByteArray &outputLine)
void GTestOutputReader::processOutput(const QByteArray &outputLineWithNewLine)
{
static QRegExp newTestStarts("^\\[-{10}\\] \\d+ tests? from (.*)$");
static QRegExp testEnds("^\\[-{10}\\] \\d+ tests? from (.*) \\((.*)\\)$");
@@ -74,7 +74,7 @@ void GTestOutputReader::processOutput(const QByteArray &outputLine)
static QRegExp errorLocation("^(.*)\\((\\d+)\\): error:.*$");
static QRegExp iterations("^Repeating all tests \\(iteration (\\d+)\\) \\. \\. \\.$");
const QString line = QString::fromLatin1(outputLine);
const QString line = QString::fromLatin1(chopLineBreak(outputLineWithNewLine));
if (line.trimmed().isEmpty())
return;