Make tst_qqmlprofilerservice more robust
authorKai Koehne <kai.koehne@digia.com>
Fri, 15 Nov 2013 12:02:13 +0000 (13:02 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 15 Nov 2013 12:07:01 +0000 (13:07 +0100)
Don't expect only application output to be printed. E.g. a stray
qDebug somewhere in Qt could break this test so far ...

Change-Id: Ibdc31fba3bd8d822c264bd44515d16e648db9a8e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp

index 902e525..beb2bb5 100644 (file)
@@ -450,8 +450,9 @@ void tst_QQmlProfilerService::scenegraphData()
     QTRY_COMPARE(m_client->state(), QQmlDebugClient::Enabled);
 
     m_client->setTraceState(true);
-    QVERIFY(QQmlDebugTest::waitForSignal(m_process, SIGNAL(readyReadStandardOutput())));
-    QVERIFY(m_process->output().indexOf(QLatin1String("tick")) != -1);
+
+    while (!m_process->output().contains(QLatin1String("tick")))
+        QVERIFY(QQmlDebugTest::waitForSignal(m_process, SIGNAL(readyReadStandardOutput())));
     m_client->setTraceState(false);
 
     QVERIFY2(QQmlDebugTest::waitForSignal(m_client, SIGNAL(complete())), "No trace received in time.");