diff options
Diffstat (limited to 'libqsystemtest/qsystemtest.cpp')
-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 76d9f87..945a6b2 100644 --- a/libqsystemtest/qsystemtest.cpp +++ b/libqsystemtest/qsystemtest.cpp @@ -281,6 +281,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 device_control; delete event_timer; |