diff options
author | Kai Koehne <kai.koehne@nokia.com> | 2012-02-17 15:56:14 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-21 11:04:58 +0100 |
commit | 784d867d2b79fcfdbf039456fcfe0692652fec52 (patch) | |
tree | a8e4dc77f832a05a36aebc9e984193bad265b605 /tests/auto | |
parent | c7ec69b4a7c2aa6dbee723c027e3283bd34d50fc (diff) |
v8profiler: Actually submit data
Fix regression introduced in 82dfecab3.
Change-Id: Icd90c483b9b2fde8d4cf522f3a35368cd395b120
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/declarative/debugger/qv8profilerservice/data/console.qml | 14 | ||||
-rw-r--r-- | tests/auto/declarative/debugger/qv8profilerservice/tst_qv8profilerservice.cpp | 52 |
2 files changed, 41 insertions, 25 deletions
diff --git a/tests/auto/declarative/debugger/qv8profilerservice/data/console.qml b/tests/auto/declarative/debugger/qv8profilerservice/data/console.qml new file mode 100644 index 0000000000..c23c820216 --- /dev/null +++ b/tests/auto/declarative/debugger/qv8profilerservice/data/console.qml @@ -0,0 +1,14 @@ +import QtQuick 2.0 + + +Item { + function f() + { + } + + Component.onCompleted: { + console.profile(); + f(); + console.profileEnd(); + } +} diff --git a/tests/auto/declarative/debugger/qv8profilerservice/tst_qv8profilerservice.cpp b/tests/auto/declarative/debugger/qv8profilerservice/tst_qv8profilerservice.cpp index 3ec92f9987..92b893afc6 100644 --- a/tests/auto/declarative/debugger/qv8profilerservice/tst_qv8profilerservice.cpp +++ b/tests/auto/declarative/debugger/qv8profilerservice/tst_qv8profilerservice.cpp @@ -125,6 +125,7 @@ private slots: void nonBlockingConnect(); void snapshot(); void profileOnExit(); + void console(); }; void QV8ProfilerClient::messageReceived(const QByteArray &message) @@ -193,6 +194,9 @@ void tst_QV8ProfilerService::connect(bool block, const QString &testFile) void tst_QV8ProfilerService::cleanup() { + if (QTest::currentTestFailed()) + qDebug() << "Application Output:" << m_process->output(); + delete m_process; delete m_connection; delete m_client; @@ -205,11 +209,8 @@ void tst_QV8ProfilerService::blockingConnectWithTraceEnabled() m_client->startProfiling(""); m_client->stopProfiling(""); - if (!QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete()))) { - QString failMsg - = QString("No trace received in time. App output: %1\n\n").arg(m_process->output()); - QFAIL(qPrintable(failMsg)); - } + QVERIFY2(QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete())), + "No trace received in time."); } void tst_QV8ProfilerService::blockingConnectWithTraceDisabled() @@ -225,11 +226,8 @@ void tst_QV8ProfilerService::blockingConnectWithTraceDisabled() } m_client->startProfiling(""); m_client->stopProfiling(""); - if (!QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete()))) { - QString failMsg - = QString("No trace received in time. App output: %1\n\n").arg(m_process->output()); - QFAIL(qPrintable(failMsg)); - } + QVERIFY2(QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete())), + "No trace received in time."); } void tst_QV8ProfilerService::nonBlockingConnect() @@ -239,11 +237,8 @@ void tst_QV8ProfilerService::nonBlockingConnect() m_client->startProfiling(""); m_client->stopProfiling(""); - if (!QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete()))) { - QString failMsg - = QString("No trace received in time. App output: %1\n\n").arg(m_process->output()); - QFAIL(qPrintable(failMsg)); - } + QVERIFY2(QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete())), + "No trace received in time."); } void tst_QV8ProfilerService::snapshot() @@ -252,11 +247,8 @@ void tst_QV8ProfilerService::snapshot() QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled); m_client->takeSnapshot(); - if (!QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(snapshot()))) { - QString failMsg - = QString("No snapshot received in time. App output: %1\n\n").arg(m_process->output()); - QFAIL(qPrintable(failMsg)); - } + QVERIFY2(QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(snapshot())), + "No trace received in time."); } void tst_QV8ProfilerService::profileOnExit() @@ -266,11 +258,21 @@ void tst_QV8ProfilerService::profileOnExit() m_client->startProfiling(""); - if (!QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete()))) { - QString failMsg - = QString("No trace received in time. App output: \n%1\n").arg(m_process->output()); - QFAIL(qPrintable(failMsg)); - } + QVERIFY2(QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete())), + "No trace received in time."); + //QVERIFY(!m_client->traceMessages.isEmpty()); +} + +void tst_QV8ProfilerService::console() +{ + connect(true, "console.qml"); + QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled); + + m_client->stopProfiling(""); + + QVERIFY2(QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete())), + "No trace received in time."); + QVERIFY(!m_client->traceMessages.isEmpty()); } QTEST_MAIN(tst_QV8ProfilerService) |