diff --git a/tests/auto/utils/process/tst_process.cpp b/tests/auto/utils/process/tst_process.cpp index 6ba3989b2d9..d4a2ee95dc6 100644 --- a/tests/auto/utils/process/tst_process.cpp +++ b/tests/auto/utils/process/tst_process.cpp @@ -258,6 +258,8 @@ static QByteArray readData(Process *process, QProcess::ProcessChannel processCha QByteArray buffer = processChannel == QProcess::StandardOutput ? process->readAllRawStandardOutput() : process->readAllRawStandardError(); buffer.replace("\r\n", "\n"); // Needed for Windows only + if (buffer.endsWith('\n')) + buffer.chop(1); // TODO: otherwise it's flaky on linux / mac, investigate why? return buffer; } @@ -280,12 +282,12 @@ void tst_Process::multiRead() process.writeRaw("hi\n"); QVERIFY(process.waitForReadyRead(1000)); buffer = readData(&process, processChannel); - QCOMPARE(buffer, QByteArray("hi\n")); + QCOMPARE(buffer, QByteArray("hi")); process.writeRaw("you\n"); QVERIFY(process.waitForReadyRead(1000)); buffer = readData(&process, processChannel); - QCOMPARE(buffer, QByteArray("you\n")); + QCOMPARE(buffer, QByteArray("you")); process.writeRaw("exit\n"); QVERIFY(process.waitForFinished(1000));