From 29beac9aa1daf9a044dc62e567283779e68b3724 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 8 Oct 2013 11:02:24 +0200 Subject: Improve output of test case Change-Id: Ib36583120ca42835534f0f8494637aeb9618f317 Reviewed-by: Aurindam Jana --- tests/auto/qml/debugger/shared/debugutil.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'tests/auto/qml/debugger/shared/debugutil.cpp') diff --git a/tests/auto/qml/debugger/shared/debugutil.cpp b/tests/auto/qml/debugger/shared/debugutil.cpp index 99647cda11..560c9ca9f3 100644 --- a/tests/auto/qml/debugger/shared/debugutil.cpp +++ b/tests/auto/qml/debugger/shared/debugutil.cpp @@ -97,6 +97,8 @@ QQmlDebugProcess::QQmlDebugProcess(const QString &executable, QObject *parent) m_timer.setSingleShot(true); m_timer.setInterval(5000); connect(&m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(processAppOutput())); + connect(&m_process, SIGNAL(error(QProcess::ProcessError)), + this, SLOT(processError(QProcess::ProcessError))); connect(&m_timer, SIGNAL(timeout()), SLOT(timeout())); } @@ -161,7 +163,7 @@ void QQmlDebugProcess::stop() void QQmlDebugProcess::timeout() { qWarning() << "Timeout while waiting for QML debugging messages " - "in application output. Process is in state" << m_process.state() << "."; + "in application output. Process is in state" << m_process.state() << ", Output:" << m_output << "."; m_eventLoop.quit(); } @@ -246,3 +248,21 @@ void QQmlDebugProcess::processAppOutput() if (outputFromAppItself) emit readyReadStandardOutput(); } + +void QQmlDebugProcess::processError(QProcess::ProcessError error) +{ + if (!m_eventLoop.isRunning()) + return; + + qDebug() << "An error occurred while waiting for debug process to become available:"; + switch (error) { + case QProcess::FailedToStart: qDebug() << "Process failed to start."; break; + case QProcess::Crashed: qDebug() << "Process crashed."; break; + case QProcess::Timedout: qDebug() << "Process timed out."; break; + case QProcess::WriteError: qDebug() << "Error while writing to process."; break; + case QProcess::ReadError: qDebug() << "Error while reading from process."; break; + case QProcess::UnknownError: qDebug() << "Unknown process error."; break; + } + + m_eventLoop.exit(); +} -- cgit v1.2.3