summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJannis Voelker <jannis.voelker@basyskom.com>2019-01-07 09:37:25 +0100
committerRainer Keller <Rainer.Keller@qt.io>2019-01-07 11:12:25 +0000
commitbbb4a2f9772cb2500b6fd68645be13c2f688dc4a (patch)
tree46f35dfadc1f3544fa2e31eae2b22ca3968929f5
parentaf2a5fab4afc630c207962ca2bf36719e0dd2fcb (diff)
Fix tests on macOS
The path for the open62541 test server is different on the macOS platform. Change-Id: I7aef3bf409a06164a5a4f708e318a7ca693a91cb Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
-rw-r--r--tests/auto/declarative/tst_opcua.cpp7
-rw-r--r--tests/auto/qopcuaclient/tst_client.cpp7
2 files changed, 14 insertions, 0 deletions
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,6 +63,11 @@ 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
@@ -70,6 +75,8 @@ public slots:
#ifdef Q_OS_WIN
+ QLatin1String(".exe")
#endif
+
+#endif
;
qDebug() << "Server Path:" << m_testServerPath;
if (!QFile::exists(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,6 +545,11 @@ 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
@@ -552,6 +557,8 @@ void Tst_QOpcUaClient::initTestCase()
#ifdef Q_OS_WIN
+ QLatin1String(".exe")
#endif
+
+#endif
;
if (!QFile::exists(m_testServerPath)) {
qDebug() << "Server Path:" << m_testServerPath;