From bbb4a2f9772cb2500b6fd68645be13c2f688dc4a Mon Sep 17 00:00:00 2001 From: Jannis Voelker Date: Mon, 7 Jan 2019 09:37:25 +0100 Subject: Fix tests on macOS The path for the open62541 test server is different on the macOS platform. Change-Id: I7aef3bf409a06164a5a4f708e318a7ca693a91cb Reviewed-by: Maurice Kalinowski Reviewed-by: Frank Meerkoetter --- tests/auto/declarative/tst_opcua.cpp | 7 +++++++ tests/auto/qopcuaclient/tst_client.cpp | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/tests/auto/declarative/tst_opcua.cpp b/tests/auto/declarative/tst_opcua.cpp index a14b05d..2807a3f 100644 --- a/tests/auto/declarative/tst_opcua.cpp +++ b/tests/auto/declarative/tst_opcua.cpp @@ -63,12 +63,19 @@ public slots: if (qEnvironmentVariableIsEmpty("OPCUA_HOST") && qEnvironmentVariableIsEmpty("OPCUA_PORT")) { m_testServerPath = qApp->applicationDirPath() + +#if defined(Q_OS_MACOS) + + QLatin1String("/../../open62541-testserver/open62541-testserver.app/Contents/MacOS/open62541-testserver") +#else + #ifdef Q_OS_WIN + QLatin1String("/..") #endif + QLatin1String("/../../open62541-testserver/open62541-testserver") #ifdef Q_OS_WIN + QLatin1String(".exe") +#endif + #endif ; qDebug() << "Server Path:" << m_testServerPath; diff --git a/tests/auto/qopcuaclient/tst_client.cpp b/tests/auto/qopcuaclient/tst_client.cpp index f12a96a..679ecc7 100644 --- a/tests/auto/qopcuaclient/tst_client.cpp +++ b/tests/auto/qopcuaclient/tst_client.cpp @@ -545,12 +545,19 @@ void Tst_QOpcUaClient::initTestCase() if (qEnvironmentVariableIsEmpty("OPCUA_HOST") && qEnvironmentVariableIsEmpty("OPCUA_PORT")) { m_testServerPath = qApp->applicationDirPath() + +#if defined(Q_OS_MACOS) + + QLatin1String("/../../open62541-testserver/open62541-testserver.app/Contents/MacOS/open62541-testserver") +#else + #ifdef Q_OS_WIN + QLatin1String("/..") #endif + QLatin1String("/../../open62541-testserver/open62541-testserver") #ifdef Q_OS_WIN + QLatin1String(".exe") +#endif + #endif ; if (!QFile::exists(m_testServerPath)) { -- cgit v1.2.3