diff options
author | Kevin Funk <kevin.funk.ford@kdab.com> | 2017-09-25 18:32:22 +0200 |
---|---|---|
committer | Kevin Funk <kevin.funk@kdab.com> | 2017-09-25 17:13:16 +0000 |
commit | ff88937e26c9ff60dd38f281f3ca15c69001d900 (patch) | |
tree | f0f176fa71239d4b29e53f1d9f679a492a56f361 /tests/auto/integration/tst_integration.cpp | |
parent | dbaeba71a7f5a8e10cfcdfce8137d23469233721 (diff) |
tst_integration: Fix executable lookup
Make localServerConnectionTest and localServerConnectionTest2 test work
even if tst_integration unit test was started from a different working
directory
Change-Id: Idad757072e43cd82cf8f3178683496db9bf1ee66
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Diffstat (limited to 'tests/auto/integration/tst_integration.cpp')
-rw-r--r-- | tests/auto/integration/tst_integration.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/auto/integration/tst_integration.cpp b/tests/auto/integration/tst_integration.cpp index f5c7b99..92741f2 100644 --- a/tests/auto/integration/tst_integration.cpp +++ b/tests/auto/integration/tst_integration.cpp @@ -26,6 +26,8 @@ ** ****************************************************************************/ +#include "../../shared/testutils.h" + #include <QtTest/QtTest> #include <QMetaType> #include <QProcess> @@ -1211,8 +1213,10 @@ private slots: #ifdef Q_OS_LINUX void localServerConnectionTest() { - QProcess testServer; - const QString progName = QStringLiteral("../../localsockettestserver/localsockettestserver"); + const auto progName = TestUtils::findExecutable("localsockettestserver", { + QCoreApplication::applicationDirPath() + "/../../localsockettestserver" + }); + //create a fake socket as killing doesn't produce a necessarily unusable socket QFile fake(QDir::temp().absoluteFilePath(QStringLiteral("crashMe"))); fake.remove(); @@ -1228,6 +1232,7 @@ private slots: QScopedPointer<QRemoteObjectDynamicReplica> replica; replica.reset(localSocketTestClient.acquireDynamic(objectname)); + QProcess testServer; testServer.start(progName); QVERIFY(testServer.waitForStarted()); QVERIFY(localSocketTestClient.lastError() == QRemoteObjectNode::NoError); @@ -1239,9 +1244,11 @@ private slots: // Tests to take over an existing socket if its still valid void localServerConnectionTest2() { - QProcess testServer; - const QString progName = QStringLiteral("../../localsockettestserver/localsockettestserver"); + const auto progName = TestUtils::findExecutable("localsockettestserver", { + QCoreApplication::applicationDirPath() + "/../../localsockettestserver" + }); + QProcess testServer; testServer.start(progName); QVERIFY(testServer.waitForStarted()); QFileInfo info(QDir::temp().absoluteFilePath(QStringLiteral("crashMe"))); |