From: Ulf Hermann Date: Wed, 29 Jan 2014 15:33:39 +0000 (+0100) Subject: Properly wait for stdout in test X-Git-Tag: upstream/5.2.90+alpha~324 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0c7ef1b350dd826334370a70e1d3b6b47e08a731;p=platform%2Fupstream%2Fqtdeclarative.git Properly wait for stdout in test Assuming all output is available on the first readyReadStandardOutput() signal leads to flaky test results. Change-Id: I442d7edc905abc067d6c32a4a55afd42ed03e3c9 Reviewed-by: Simon Hausmann --- diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp index 9d2e0ecbb..a12284622 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp +++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp @@ -406,9 +406,9 @@ void tst_QQmlProfilerService::pixmapCacheData() m_client->setTraceState(true); QVERIFY(QQmlDebugTest::waitForSignal(m_process, SIGNAL(readyReadStandardOutput()))); - QVERIFY(m_process->output().indexOf(QLatin1String("image loaded")) != -1 || - m_process->output().indexOf(QLatin1String("image error")) != -1 ); - + while (m_process->output().indexOf(QLatin1String("image loaded")) == -1 && + m_process->output().indexOf(QLatin1String("image error")) == -1) + QVERIFY(QQmlDebugTest::waitForSignal(m_process, SIGNAL(readyReadStandardOutput()))); m_client->setTraceState(false);