summaryrefslogtreecommitdiffstats
path: root/tests/auto/dbus/qdbusmarshall
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-01-01 18:21:35 -0200
committerThiago Macieira <thiago.macieira@intel.com>2015-01-02 17:25:01 +0100
commit6d3558b4492027f54e6dab702c115a251eb9e9d0 (patch)
tree7231c0cd0740bac6127036bdc4cadd912e34e6be /tests/auto/dbus/qdbusmarshall
parent5fefec9136fb2aac73f9e54037d2f6809021f011 (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/qdbusmarshall')
-rw-r--r--tests/auto/dbus/qdbusmarshall/qpong/qpong.cpp5
-rw-r--r--tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp5
2 files changed, 8 insertions, 2 deletions
diff --git a/tests/auto/dbus/qdbusmarshall/qpong/qpong.cpp b/tests/auto/dbus/qdbusmarshall/qpong/qpong.cpp
index bb8aab3d21..11cd4f05ce 100644
--- a/tests/auto/dbus/qdbusmarshall/qpong/qpong.cpp
+++ b/tests/auto/dbus/qdbusmarshall/qpong/qpong.cpp
@@ -49,6 +49,11 @@ public slots:
if (!QDBusConnection::sessionBus().send(msg.createReply(msg.arguments())))
exit(1);
}
+
+ void quit()
+ {
+ qApp->quit();
+ }
};
int main(int argc, char *argv[])
diff --git a/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp b/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp
index 4d12522a68..0ab03e7dd8 100644
--- a/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp
+++ b/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp
@@ -143,9 +143,10 @@ void tst_QDBusMarshall::initTestCase()
void tst_QDBusMarshall::cleanupTestCase()
{
- proc.close();
- proc.terminate();
+ QDBusMessage msg = QDBusMessage::createMethodCall(serviceName, objectPath, interfaceName, "quit");
+ QDBusConnection::sessionBus().call(msg);
proc.waitForFinished(200);
+ proc.close();
}
int tst_QDBusMarshall::fileDescriptorForTest()