diff options
author | Keith Isdale <keith.isdale@nokia.com> | 2010-07-23 15:21:36 +1000 |
---|---|---|
committer | Keith Isdale <keith.isdale@nokia.com> | 2010-07-23 15:21:36 +1000 |
commit | 80326b34a08ca7d8547f8c0c8ac6f857cddc643a (patch) | |
tree | 7896aeebbc119bfda9027ed07db300a3a3014474 | |
parent | 90cbe9b5b9427471a40ca74e0adecb296f8dea4b (diff) |
Ensure that we stop any running remote applications
-rw-r--r-- | libqsystemtest/qsystemtest.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libqsystemtest/qsystemtest.cpp b/libqsystemtest/qsystemtest.cpp index c984208..50808cd 100644 --- a/libqsystemtest/qsystemtest.cpp +++ b/libqsystemtest/qsystemtest.cpp @@ -275,6 +275,25 @@ QSystemTest::~QSystemTest() delete proc; } } + // ensure that we stop any running remote applications + if (runsOnDevice()){ + QProcess proc; + while (m_remote_aut.count()) { + QStringList args; + QString aut = m_remote_aut.takeFirst(); + args << aut; + qWarning(QString("Stopping remote process %1").arg(aut).toLatin1().constData()); + static QByteArray stopProcess = qgetenv("QTUITEST_STOP_PROCESS"); + if (stopProcess.isEmpty()) { + fail(QString("Could not stop remote process '%1', QTUITEST_STOP_PROCESS not defined.").arg(aut)); + } + proc.start(stopProcess, args); + if (!proc.waitForFinished(10000)) { + proc.kill(); + proc.waitForFinished(5000); + } + } + } delete event_timer; delete m_test_app; |