aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/debugger/shared/debugutil.cpp
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2012-03-16 16:44:24 +0100
committerQt by Nokia <qt-info@nokia.com>2012-04-25 11:46:16 +0200
commitb70c84564a135090740d2db98c04bf9ee8a6a4aa (patch)
treef4c13700e953f92564edd827357b997314931485 /tests/auto/qml/debugger/shared/debugutil.cpp
parenta5d4efbc0035a0a3356e6d69a7b7b1c2d17ff253 (diff)
Debugger: Improve output of autotests
Change-Id: Ib938d2f39d8a0928c257ef923df5d5fcfa85c4cf Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
Diffstat (limited to 'tests/auto/qml/debugger/shared/debugutil.cpp')
-rw-r--r--tests/auto/qml/debugger/shared/debugutil.cpp31
1 files changed, 28 insertions, 3 deletions
diff --git a/tests/auto/qml/debugger/shared/debugutil.cpp b/tests/auto/qml/debugger/shared/debugutil.cpp
index eea777f09d..a6b24ae2b0 100644
--- a/tests/auto/qml/debugger/shared/debugutil.cpp
+++ b/tests/auto/qml/debugger/shared/debugutil.cpp
@@ -99,13 +99,36 @@ QQmlDebugProcess::~QQmlDebugProcess()
stop();
}
+QString QQmlDebugProcess::state()
+{
+ QString stateStr;
+ switch (m_process.state()) {
+ case QProcess::NotRunning: {
+ stateStr = "not running";
+ if (m_process.exitStatus() == QProcess::CrashExit)
+ stateStr += " (crashed!)";
+ else
+ stateStr += ", return value" + m_process.exitCode();
+ break;
+ }
+ case QProcess::Starting: stateStr = "starting"; break;
+ case QProcess::Running: stateStr = "running"; break;
+ }
+ return stateStr;
+}
+
void QQmlDebugProcess::start(const QStringList &arguments)
{
m_mutex.lock();
m_process.setEnvironment(m_environment);
m_process.start(m_executable, arguments);
- m_process.waitForStarted();
- m_timer.start();
+ if (!m_process.waitForStarted()) {
+ qWarning() << "QML Debug Client: Could not launch app " << m_executable
+ << ": " << m_process.errorString();
+ m_eventLoop.quit();
+ } else {
+ m_timer.start();
+ }
m_mutex.unlock();
}
@@ -120,7 +143,7 @@ void QQmlDebugProcess::stop()
void QQmlDebugProcess::timeout()
{
qWarning() << "Timeout while waiting for QML debugging messages "
- "in application output";
+ "in application output. Process is in state" << m_process.state() << ".";
m_eventLoop.quit();
}
@@ -162,12 +185,14 @@ void QQmlDebugProcess::processAppOutput()
if (line.startsWith("QML Debugger:")) {
if (line.contains("Waiting for connection ")) {
+ m_timer.stop();
m_started = true;
m_eventLoop.quit();
continue;
}
if (line.contains("Unable to listen")) {
qWarning() << "App was unable to bind to port!";
+ m_timer.stop();
m_eventLoop.quit();
continue;
}