From 2f69ca58949ceaec5c2195af6e9edfa46c1c911d Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 18 Jan 2011 18:20:35 +0100 Subject: stabilize qmake autotest on a systems with small packet windows, QProcess::readAllStandardError() might return a part of the string and the existing code adds an endl to it a bit later, causing a test failure. (I don't care about the '\r'-s here because of QString shall eat them anyways) Merge-request: 2546 Reviewed-by: Oswald Buddenhagen --- tests/auto/qmake/testcompiler.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/tests/auto/qmake/testcompiler.cpp b/tests/auto/qmake/testcompiler.cpp index 021fe9b..dbdeee8 100644 --- a/tests/auto/qmake/testcompiler.cpp +++ b/tests/auto/qmake/testcompiler.cpp @@ -142,23 +142,16 @@ bool TestCompiler::runCommand( QString cmdline ) bool failed = false; child.setReadChannel(QProcess::StandardError); - while (QProcess::Running == child.state()) { - if (child.waitForReadyRead(1000)) { - QString output = child.readAllStandardError(); - testOutput_.append(output); - - output.prepend('\n'); - if (output.contains("\nProject MESSAGE: FAILED")) - failed = true; - } - } - child.waitForFinished(-1); - return failed - ? false - : (child.exitStatus() == QProcess::NormalExit) - && (child.exitCode() == 0); + foreach (const QByteArray &output, child.readAllStandardError().split('\n')) { + testOutput_.append(QString::fromLocal8Bit(output)); + + if (output.startsWith("Project MESSAGE: FAILED")) + failed = true; + } + + return !failed && child.exitStatus() == QProcess::NormalExit && child.exitCode() == 0; } void TestCompiler::setBaseCommands( QString makeCmd, QString qmakeCmd ) -- cgit v0.12 From bf7c6ee466d93db7d5af027d5ab503998f8ebf6f Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Wed, 19 Jan 2011 10:10:14 +0100 Subject: fix doubleformat config.test add 0.0 at the end to be treated like trailing null (\0) by some versions of 'strings' cli tool Merge-request: 2550 Reviewed-by: Oswald Buddenhagen --- config.tests/unix/doubleformat/doubleformattest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.tests/unix/doubleformat/doubleformattest.cpp b/config.tests/unix/doubleformat/doubleformattest.cpp index f7b9000..b906e00 100644 --- a/config.tests/unix/doubleformat/doubleformattest.cpp +++ b/config.tests/unix/doubleformat/doubleformattest.cpp @@ -54,7 +54,7 @@ tested on x86, arm-le (gp), aix #include // equals static char c [] = "0123ABCD0123ABCD\0\0\0\0\0\0\0" -static double d [] = { 710524581542275055616.0, 710524581542275055616.0}; +static double d [] = { 710524581542275055616.0, 710524581542275055616.0, 0.0 }; int main(int argc, char **argv) { -- cgit v0.12