|
@@ -5,6 +5,17 @@ include_directories(${PROJECT_SOURCE_DIR}/plugins)
|
|
|
include_directories(${PROJECT_BINARY_DIR}/src_generated)
|
|
|
include_directories(${CHECK_INCLUDE_DIRS})
|
|
|
|
|
|
+#############################
|
|
|
+# Compiled binaries folders #
|
|
|
+#############################
|
|
|
+
|
|
|
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/tests)
|
|
|
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/tests)
|
|
|
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/tests)
|
|
|
+###
|
|
|
+
|
|
|
+set(TESTS_BINARY_DIR ${CMAKE_SOURCE_DIR}/bin/tests)
|
|
|
+
|
|
|
find_package(Check REQUIRED)
|
|
|
find_package(Threads REQUIRED)
|
|
|
if(UA_ENABLE_VALGRIND_UNIT_TESTS)
|
|
@@ -43,65 +54,65 @@ endmacro()
|
|
|
|
|
|
add_executable(check_types_builtin check_types_builtin.c $<TARGET_OBJECTS:open62541-object>)
|
|
|
target_link_libraries(check_types_builtin ${LIBS})
|
|
|
-add_test_valgrind(types_builtin ${CMAKE_CURRENT_BINARY_DIR}/check_types_builtin)
|
|
|
+add_test_valgrind(types_builtin ${TESTS_BINARY_DIR}/check_types_builtin)
|
|
|
|
|
|
add_executable(check_types_memory check_types_memory.c $<TARGET_OBJECTS:open62541-object>)
|
|
|
target_link_libraries(check_types_memory ${LIBS})
|
|
|
-add_test_valgrind(types_memory ${CMAKE_CURRENT_BINARY_DIR}/check_types_memory)
|
|
|
+add_test_valgrind(types_memory ${TESTS_BINARY_DIR}/check_types_memory)
|
|
|
|
|
|
add_executable(check_types_range check_types_range.c $<TARGET_OBJECTS:open62541-object>)
|
|
|
target_link_libraries(check_types_range ${LIBS})
|
|
|
-add_test_valgrind(types_range ${CMAKE_CURRENT_BINARY_DIR}/check_types_range)
|
|
|
+add_test_valgrind(types_range ${TESTS_BINARY_DIR}/check_types_range)
|
|
|
|
|
|
add_executable(check_types_custom check_types_custom.c $<TARGET_OBJECTS:open62541-object>)
|
|
|
target_link_libraries(check_types_custom ${LIBS})
|
|
|
-add_test_valgrind(types_custom ${CMAKE_CURRENT_BINARY_DIR}/check_types_custom)
|
|
|
+add_test_valgrind(types_custom ${TESTS_BINARY_DIR}/check_types_custom)
|
|
|
|
|
|
add_executable(check_chunking check_chunking.c $<TARGET_OBJECTS:open62541-object>)
|
|
|
target_link_libraries(check_chunking ${LIBS})
|
|
|
-add_test_valgrind(chunking ${CMAKE_CURRENT_BINARY_DIR}/check_chunking)
|
|
|
+add_test_valgrind(chunking ${TESTS_BINARY_DIR}/check_chunking)
|
|
|
|
|
|
add_executable(check_utils check_utils.c $<TARGET_OBJECTS:open62541-object>)
|
|
|
target_link_libraries(check_utils ${LIBS})
|
|
|
-add_test_valgrind(check_utils ${CMAKE_CURRENT_BINARY_DIR}/check_utils)
|
|
|
+add_test_valgrind(check_utils ${TESTS_BINARY_DIR}/check_utils)
|
|
|
|
|
|
# Test Server
|
|
|
|
|
|
add_executable(check_services_view check_services_view.c $<TARGET_OBJECTS:open62541-object>)
|
|
|
target_link_libraries(check_services_view ${LIBS})
|
|
|
-add_test_valgrind(services_view ${CMAKE_CURRENT_BINARY_DIR}/check_services_view)
|
|
|
+add_test_valgrind(services_view ${TESTS_BINARY_DIR}/check_services_view)
|
|
|
|
|
|
add_executable(check_services_attributes check_services_attributes.c $<TARGET_OBJECTS:open62541-object>)
|
|
|
target_link_libraries(check_services_attributes ${LIBS})
|
|
|
-add_test_valgrind(services_attributes ${CMAKE_CURRENT_BINARY_DIR}/check_services_attributes)
|
|
|
+add_test_valgrind(services_attributes ${TESTS_BINARY_DIR}/check_services_attributes)
|
|
|
|
|
|
add_executable(check_services_nodemanagement check_services_nodemanagement.c $<TARGET_OBJECTS:open62541-object>)
|
|
|
target_link_libraries(check_services_nodemanagement ${LIBS})
|
|
|
-add_test_valgrind(services_nodemanagement ${CMAKE_CURRENT_BINARY_DIR}/check_services_nodemanagement)
|
|
|
+add_test_valgrind(services_nodemanagement ${TESTS_BINARY_DIR}/check_services_nodemanagement)
|
|
|
|
|
|
add_executable(check_services_subscriptions check_services_subscriptions.c $<TARGET_OBJECTS:open62541-object>)
|
|
|
target_link_libraries(check_services_subscriptions ${LIBS})
|
|
|
-add_test_valgrind(check_services_subscriptions ${CMAKE_CURRENT_BINARY_DIR}/check_services_subscriptions)
|
|
|
+add_test_valgrind(check_services_subscriptions ${TESTS_BINARY_DIR}/check_services_subscriptions)
|
|
|
|
|
|
add_executable(check_nodestore check_nodestore.c $<TARGET_OBJECTS:open62541-object>)
|
|
|
target_link_libraries(check_nodestore ${LIBS})
|
|
|
-add_test_valgrind(nodestore ${CMAKE_CURRENT_BINARY_DIR}/check_nodestore)
|
|
|
+add_test_valgrind(nodestore ${TESTS_BINARY_DIR}/check_nodestore)
|
|
|
|
|
|
add_executable(check_session check_session.c $<TARGET_OBJECTS:open62541-object>)
|
|
|
target_link_libraries(check_session ${LIBS})
|
|
|
-add_test_valgrind(session ${CMAKE_CURRENT_BINARY_DIR}/check_session)
|
|
|
+add_test_valgrind(session ${TESTS_BINARY_DIR}/check_session)
|
|
|
|
|
|
add_executable(check_server_jobs check_server_jobs.c $<TARGET_OBJECTS:open62541-object>)
|
|
|
target_link_libraries(check_server_jobs ${LIBS})
|
|
|
-add_test_valgrind(check_server_jobs ${CMAKE_CURRENT_BINARY_DIR}/check_server_jobs)
|
|
|
+add_test_valgrind(check_server_jobs ${TESTS_BINARY_DIR}/check_server_jobs)
|
|
|
|
|
|
add_executable(check_server_userspace check_server_userspace.c $<TARGET_OBJECTS:open62541-object>)
|
|
|
target_link_libraries(check_server_userspace ${LIBS})
|
|
|
-add_test_valgrind(check_server_userspace ${CMAKE_CURRENT_BINARY_DIR}/check_server_userspace)
|
|
|
+add_test_valgrind(check_server_userspace ${TESTS_BINARY_DIR}/check_server_userspace)
|
|
|
|
|
|
add_executable(check_discovery check_discovery.c $<TARGET_OBJECTS:open62541-object>)
|
|
|
target_link_libraries(check_discovery ${LIBS})
|
|
|
-add_test_valgrind(discovery ${CMAKE_CURRENT_BINARY_DIR}/check_discovery)
|
|
|
+add_test_valgrind(discovery ${TESTS_BINARY_DIR}/check_discovery)
|
|
|
|
|
|
# Test server with network dumps from files
|
|
|
|
|
@@ -134,19 +145,19 @@ target_include_directories(check_server_binary_messages PRIVATE ${PROJECT_SOURCE
|
|
|
target_link_libraries(check_server_binary_messages ${LIBS})
|
|
|
add_dependencies(check_server_binary_messages client_HELOPN.bin)
|
|
|
|
|
|
-add_test_valgrind(check_server_binary_messages_browse ${CMAKE_CURRENT_BINARY_DIR}/check_server_binary_messages
|
|
|
+add_test_valgrind(check_server_binary_messages_browse ${TESTS_BINARY_DIR}/check_server_binary_messages
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/client_HELOPN.bin
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/client_CreateActivateSession.bin
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/client_Browse.bin
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/client_CLO.bin)
|
|
|
|
|
|
-add_test_valgrind(check_server_binary_messages_read ${CMAKE_CURRENT_BINARY_DIR}/check_server_binary_messages
|
|
|
+add_test_valgrind(check_server_binary_messages_read ${TESTS_BINARY_DIR}/check_server_binary_messages
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/client_HELOPN.bin
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/client_CreateActivateSession.bin
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/client_Read.bin
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/client_CLO.bin)
|
|
|
|
|
|
-add_test_valgrind(check_server_binary_messages_write ${CMAKE_CURRENT_BINARY_DIR}/check_server_binary_messages
|
|
|
+add_test_valgrind(check_server_binary_messages_write ${TESTS_BINARY_DIR}/check_server_binary_messages
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/client_HELOPN.bin
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/client_CreateActivateSession.bin
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/client_Write.bin
|
|
@@ -156,8 +167,8 @@ add_test_valgrind(check_server_binary_messages_write ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
|
|
add_executable(check_client check_client.c $<TARGET_OBJECTS:open62541-object>)
|
|
|
target_link_libraries(check_client ${LIBS})
|
|
|
-add_test_valgrind(check_client ${CMAKE_CURRENT_BINARY_DIR}/check_client)
|
|
|
+add_test_valgrind(check_client ${TESTS_BINARY_DIR}/check_client)
|
|
|
|
|
|
add_executable(check_client_subscriptions check_client_subscriptions.c $<TARGET_OBJECTS:open62541-object>)
|
|
|
target_link_libraries(check_client_subscriptions ${LIBS})
|
|
|
-add_test_valgrind(check_client_subscriptions ${CMAKE_CURRENT_BINARY_DIR}/check_client_subscriptions)
|
|
|
+add_test_valgrind(check_client_subscriptions ${TESTS_BINARY_DIR}/check_client_subscriptions)
|