diff options
author | Rainer Keller <Rainer.Keller@qt.io> | 2019-08-08 08:02:11 +0200 |
---|---|---|
committer | Rainer Keller <Rainer.Keller@qt.io> | 2019-08-12 09:35:22 +0200 |
commit | 36f2531e34dedc3f7cb669df8c8f7053219409f7 (patch) | |
tree | 14b1aa6bfc8f276260dbee7d6cc627a690ea8a5d | |
parent | 6bc4eb987dd8fd87a0a63039456b17acf8e02bcf (diff) |
tests: Fix some tests failing on windows
The checks for testserver try to establish a connection. Meanwhile the
tests already start and are missing global properties. Setting those was
moved to front.
Change-Id: I8703ee7341f7cfb4bf1edc9c952a1692ffc69c07
Reviewed-by: Jannis Völker <jannis.voelker@basyskom.com>
-rw-r--r-- | tests/auto/declarative/tst_opcua.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/auto/declarative/tst_opcua.cpp b/tests/auto/declarative/tst_opcua.cpp index 2fc387d..53816b4 100644 --- a/tests/auto/declarative/tst_opcua.cpp +++ b/tests/auto/declarative/tst_opcua.cpp @@ -63,6 +63,10 @@ public slots: const quint16 defaultPort = 43344; const QHostAddress defaultHost(QHostAddress::LocalHost); + const QString host = envOrDefault("OPCUA_HOST", defaultHost.toString()); + const QString port = envOrDefault("OPCUA_PORT", QString::number(defaultPort)); + m_opcuaDiscoveryUrl = QString::fromLatin1("opc.tcp://%1:%2").arg(host).arg(port); + if (qEnvironmentVariableIsEmpty("OPCUA_HOST") && qEnvironmentVariableIsEmpty("OPCUA_PORT")) { m_testServerPath = qApp->applicationDirPath() @@ -107,9 +111,6 @@ public slots: // Let the server come up QTest::qSleep(2000); } - const QString host = envOrDefault("OPCUA_HOST", defaultHost.toString()); - const QString port = envOrDefault("OPCUA_PORT", QString::number(defaultPort)); - m_opcuaDiscoveryUrl = QString::fromLatin1("opc.tcp://%1:%2").arg(host).arg(port); } void qmlEngineAvailable(QQmlEngine *engine) { bool value = false; |