diff options
author | Kai Koehne <kai.koehne@digia.com> | 2013-10-08 11:02:24 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-16 08:34:32 +0200 |
commit | 29beac9aa1daf9a044dc62e567283779e68b3724 (patch) | |
tree | 423dc2373ebb41b16bd0336a50477286609f080f /tests/auto/qml/debugger/shared/debugutil.cpp | |
parent | 8c66618892334b4ef0b5ecced048f96d051352bd (diff) |
Improve output of test case
Change-Id: Ib36583120ca42835534f0f8494637aeb9618f317
Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
Diffstat (limited to 'tests/auto/qml/debugger/shared/debugutil.cpp')
-rw-r--r-- | tests/auto/qml/debugger/shared/debugutil.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
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(); +} |