Commit 07ba6bc7 authored by Christian Stenger's avatar Christian Stenger
Browse files

Redo processing output to avoid costly functions



Change-Id: I8fa0a84f49b981909d5ac61ef7993c3569aafa2b
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@theqtcompany.com>
parent 059f8cf3
......@@ -324,16 +324,22 @@ void TestOutputReader::processGTestOutput()
static QString description;
static QByteArray unprocessed;
while (m_testApplication->canReadLine())
unprocessed.append(m_testApplication->readLine());
int lineBreak;
while ((lineBreak = unprocessed.indexOf('\n')) != -1) {
const QString line = QLatin1String(unprocessed.left(lineBreak));
unprocessed.remove(0, lineBreak + 1);
if (line.isEmpty()) {
while (m_testApplication->canReadLine()) {
QByteArray read = m_testApplication->readLine();
if (!unprocessed.isEmpty()) {
read = unprocessed + read;
unprocessed.clear();
}
if (!read.endsWith('\n')) {
unprocessed = read;
continue;
}
read.chop(1); // remove the newline from the output
const QString line = QString::fromLatin1(read);
if (line.trimmed().isEmpty())
continue;
if (!line.startsWith(QLatin1Char('['))) {
description.append(line).append(QLatin1Char('\n'));
if (line.startsWith(QStringLiteral("Note:"))) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment