diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2015-01-01 18:21:35 -0200 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2015-01-02 17:25:01 +0100 |
commit | 6d3558b4492027f54e6dab702c115a251eb9e9d0 (patch) | |
tree | 7231c0cd0740bac6127036bdc4cadd912e34e6be /tests/auto/dbus/qdbusabstractinterface | |
parent | 5fefec9136fb2aac73f9e54037d2f6809021f011 (diff) |
Autotest: Be nicer when asking the sub-processes to exit
Instead of killing them outright (and note that terminate() doesn't work
on Windows), ask them nicely to exit on their own. This way, if we run
them in valgrind, valgrind gets a chance to print the leak check output
and summary.
Change-Id: Ib6cc8d4560ff0bf255f94980eb220e97592c00f0
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Diffstat (limited to 'tests/auto/dbus/qdbusabstractinterface')
-rw-r--r-- | tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp | 5 | ||||
-rw-r--r-- | tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp | 17 |
2 files changed, 9 insertions, 13 deletions
diff --git a/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp b/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp index 49462d388c..900faeb68e 100644 --- a/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp +++ b/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp @@ -87,6 +87,11 @@ public slots: emit targetObj.complexSignal(reg); } + void quit() + { + qApp->quit(); + } + private slots: void handleConnection(const QDBusConnection& con) { diff --git a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp index 0cb29d121b..78b8054344 100644 --- a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp +++ b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp @@ -252,19 +252,10 @@ void tst_QDBusAbstractInterface::initTestCase() void tst_QDBusAbstractInterface::cleanupTestCase() { - // Kill peer, resetting the object exported by a separate process -#ifdef Q_OS_WIN - proc.kill(); // non-GUI processes don't respond to QProcess::terminate() -#else - proc.terminate(); -#endif - QVERIFY(proc.waitForFinished() || proc.state() == QProcess::NotRunning); - - // Wait until the service is certainly not registered - QDBusConnection con = QDBusConnection::sessionBus(); - if (con.isConnected()) { - QTRY_VERIFY(!con.interface()->isServiceRegistered(serviceName)); - } + QDBusMessage msg = QDBusMessage::createMethodCall(serviceName, objectPath, interfaceName, "quit"); + QDBusConnection::sessionBus().call(msg); + proc.waitForFinished(200); + proc.close(); } void tst_QDBusAbstractInterface::init() |