summaryrefslogtreecommitdiffstats
path: root/tests/auto/qmake
diff options
context:
space:
mode:
authorRitt Konstantin <ritt.ks@gmail.com>2011-01-18 17:20:35 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-01-19 01:11:52 (GMT)
commit2f69ca58949ceaec5c2195af6e9edfa46c1c911d (patch)
treec48342391bee010287873404ee27e95717526d51 /tests/auto/qmake
parent11815c63abeaf2b768e0cf59a83b53ff2b160b05 (diff)
downloadQt-2f69ca58949ceaec5c2195af6e9edfa46c1c911d.zip
Qt-2f69ca58949ceaec5c2195af6e9edfa46c1c911d.tar.gz
Qt-2f69ca58949ceaec5c2195af6e9edfa46c1c911d.tar.bz2
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 <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'tests/auto/qmake')
-rw-r--r--tests/auto/qmake/testcompiler.cpp23
1 files 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 )