diff options
author | Jannis Voelker <jannis.voelker@basyskom.com> | 2020-06-05 09:24:35 +0200 |
---|---|---|
committer | Jannis Voelker <jannis.voelker@basyskom.com> | 2020-06-05 17:24:09 +0200 |
commit | 83e9876127c7317019305e251de1ebb1ca0b30ce (patch) | |
tree | 5a8f5e2f22eee01fa7102f5c84cbf7504fcdadab | |
parent | 33959bceb1f998cb40e876788d709a339b366fc2 (diff) |
CMake: Add specific path for the test server
The CMake build does not create the debug / release directories
and the test applications can't find open62541-testserver.
Change-Id: I63cb38ada6c1ce22773d5fb3fc741dbd24ec196c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r-- | tests/auto/clientSetupInCpp/CMakeLists.txt | 6 | ||||
-rw-r--r-- | tests/auto/clientSetupInCpp/tst_clientSetupInCpp.cpp | 2 | ||||
-rw-r--r-- | tests/auto/connection/CMakeLists.txt | 6 | ||||
-rw-r--r-- | tests/auto/connection/tst_connection.cpp | 2 | ||||
-rw-r--r-- | tests/auto/declarative/CMakeLists.txt | 6 | ||||
-rw-r--r-- | tests/auto/declarative/tst_opcua.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qopcuaclient/CMakeLists.txt | 6 | ||||
-rw-r--r-- | tests/auto/qopcuaclient/tst_client.cpp | 2 | ||||
-rw-r--r-- | tests/auto/security/CMakeLists.txt | 5 | ||||
-rw-r--r-- | tests/auto/security/tst_security.cpp | 2 |
10 files changed, 34 insertions, 5 deletions
diff --git a/tests/auto/clientSetupInCpp/CMakeLists.txt b/tests/auto/clientSetupInCpp/CMakeLists.txt index b707651..ec32622 100644 --- a/tests/auto/clientSetupInCpp/CMakeLists.txt +++ b/tests/auto/clientSetupInCpp/CMakeLists.txt @@ -31,3 +31,9 @@ extend_target(tst_clientSetupInCpp CONDITION QT_FEATURE_mbedtls DEFINES SERVER_SUPPORTS_SECURITY ) + +# special case begin +if (WIN32) + target_compile_definitions(tst_clientSetupInCpp PRIVATE TESTS_CMAKE_SPECIFIC_PATH) +endif() +# special case end diff --git a/tests/auto/clientSetupInCpp/tst_clientSetupInCpp.cpp b/tests/auto/clientSetupInCpp/tst_clientSetupInCpp.cpp index 2e6eed7..1108e84 100644 --- a/tests/auto/clientSetupInCpp/tst_clientSetupInCpp.cpp +++ b/tests/auto/clientSetupInCpp/tst_clientSetupInCpp.cpp @@ -124,7 +124,7 @@ public slots: + QLatin1String("/../../open62541-testserver/open62541-testserver.app/Contents/MacOS/open62541-testserver") #else -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) && !defined(TESTS_CMAKE_SPECIFIC_PATH) + QLatin1String("/..") #endif + QLatin1String("/../../open62541-testserver/open62541-testserver") diff --git a/tests/auto/connection/CMakeLists.txt b/tests/auto/connection/CMakeLists.txt index bff329b..36cbc2b 100644 --- a/tests/auto/connection/CMakeLists.txt +++ b/tests/auto/connection/CMakeLists.txt @@ -13,3 +13,9 @@ qt_add_test(tst_connection PUBLIC_LIBRARIES Qt::OpcUa ) + +# special case begin +if (WIN32) + target_compile_definitions(tst_connection PRIVATE TESTS_CMAKE_SPECIFIC_PATH) +endif() +# special case end diff --git a/tests/auto/connection/tst_connection.cpp b/tests/auto/connection/tst_connection.cpp index 639cd5d..db7e562 100644 --- a/tests/auto/connection/tst_connection.cpp +++ b/tests/auto/connection/tst_connection.cpp @@ -118,7 +118,7 @@ void Tst_Connection::initTestCase() + QLatin1String("/../../open62541-testserver/open62541-testserver.app/Contents/MacOS/open62541-testserver") #else -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) && !defined(TESTS_CMAKE_SPECIFIC_PATH) + QLatin1String("/..") #endif + QLatin1String("/../../open62541-testserver/open62541-testserver") diff --git a/tests/auto/declarative/CMakeLists.txt b/tests/auto/declarative/CMakeLists.txt index d7d4f3b..40ade46 100644 --- a/tests/auto/declarative/CMakeLists.txt +++ b/tests/auto/declarative/CMakeLists.txt @@ -31,3 +31,9 @@ qt_extend_target(tst_opcua CONDITION QT_FEATURE_mbedtls DEFINES SERVER_SUPPORTS_SECURITY ) + +# special case begin +if (WIN32) + target_compile_definitions(tst_opcua PRIVATE TESTS_CMAKE_SPECIFIC_PATH) +endif() +# special case end diff --git a/tests/auto/declarative/tst_opcua.cpp b/tests/auto/declarative/tst_opcua.cpp index 53816b4..3f7d2d6 100644 --- a/tests/auto/declarative/tst_opcua.cpp +++ b/tests/auto/declarative/tst_opcua.cpp @@ -74,7 +74,7 @@ public slots: + QLatin1String("/../../open62541-testserver/open62541-testserver.app/Contents/MacOS/open62541-testserver") #else -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) && !defined(TESTS_CMAKE_SPECIFIC_PATH) + QLatin1String("/..") #endif + QLatin1String("/../../open62541-testserver/open62541-testserver") diff --git a/tests/auto/qopcuaclient/CMakeLists.txt b/tests/auto/qopcuaclient/CMakeLists.txt index d43823c..768d4f3 100644 --- a/tests/auto/qopcuaclient/CMakeLists.txt +++ b/tests/auto/qopcuaclient/CMakeLists.txt @@ -35,3 +35,9 @@ qt_extend_target(tst_qopcuaclient CONDITION QT_FEATURE_mbedtls DEFINES SERVER_SUPPORTS_SECURITY ) + +# special case begin +if (WIN32) + target_compile_definitions(tst_qopcuaclient PRIVATE TESTS_CMAKE_SPECIFIC_PATH) +endif() +# special case end diff --git a/tests/auto/qopcuaclient/tst_client.cpp b/tests/auto/qopcuaclient/tst_client.cpp index cde84d5..af660f4 100644 --- a/tests/auto/qopcuaclient/tst_client.cpp +++ b/tests/auto/qopcuaclient/tst_client.cpp @@ -568,7 +568,7 @@ void Tst_QOpcUaClient::initTestCase() + QLatin1String("/../../open62541-testserver/open62541-testserver.app/Contents/MacOS/open62541-testserver") #else -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) && !defined(TESTS_CMAKE_SPECIFIC_PATH) + QLatin1String("/..") #endif + QLatin1String("/../../open62541-testserver/open62541-testserver") diff --git a/tests/auto/security/CMakeLists.txt b/tests/auto/security/CMakeLists.txt index 2a53c9e..0a47ed7 100644 --- a/tests/auto/security/CMakeLists.txt +++ b/tests/auto/security/CMakeLists.txt @@ -32,3 +32,8 @@ qt_add_resource(tst_security "certs" ${certs_resource_files} ) +# special case begin +if (WIN32) + target_compile_definitions(tst_security PRIVATE TESTS_CMAKE_SPECIFIC_PATH) +endif() +# special case end diff --git a/tests/auto/security/tst_security.cpp b/tests/auto/security/tst_security.cpp index 6b68bc2..97436b9 100644 --- a/tests/auto/security/tst_security.cpp +++ b/tests/auto/security/tst_security.cpp @@ -188,7 +188,7 @@ void Tst_QOpcUaSecurity::initTestCase() + QLatin1String("/../../open62541-testserver/open62541-testserver.app/Contents/MacOS/open62541-testserver") #else -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) && !defined(TESTS_CMAKE_SPECIFIC_PATH) + QLatin1String("/..") #endif + QLatin1String("/../../open62541-testserver/open62541-testserver") |