123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350 |
- include_directories(${PROJECT_SOURCE_DIR}/include)
- include_directories(${PROJECT_SOURCE_DIR}/deps)
- include_directories(${PROJECT_SOURCE_DIR}/src)
- include_directories(${PROJECT_SOURCE_DIR}/src/server)
- 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_BINARY_DIR}/bin/tests)
- set(TESTS_BINARY_DIR ${CMAKE_BINARY_DIR}/bin/tests)
- # Load CMake Packages
- find_package(Check REQUIRED)
- find_package(Threads REQUIRED)
- if(UA_ENABLE_VALGRIND_UNIT_TESTS)
- find_package(Valgrind REQUIRED)
- endif()
- set(LIBS subunit ${CHECK_LIBRARIES} ${open62541_LIBRARIES})
- # Use different plugins for testing
- set(test_plugin_sources ${PROJECT_SOURCE_DIR}/plugins/ua_network_tcp.c
- ${PROJECT_SOURCE_DIR}/tests/testing_clock.c
- ${PROJECT_SOURCE_DIR}/plugins/ua_log_stdout.c
- ${PROJECT_SOURCE_DIR}/plugins/ua_config_default.c
- ${PROJECT_SOURCE_DIR}/plugins/ua_accesscontrol_default.c
- ${PROJECT_SOURCE_DIR}/plugins/ua_nodestore_default.c
- ${PROJECT_SOURCE_DIR}/tests/testing_clock.c
- ${PROJECT_SOURCE_DIR}/plugins/ua_securitypolicy_none.c)
- add_library(open62541-testplugins OBJECT ${test_plugin_sources})
- add_dependencies(open62541-testplugins open62541)
- # Workaround some clang warnings in the uni tests
- if((NOT ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") AND (CMAKE_COMPILER_IS_GNUCC OR "x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang"))
- add_definitions(-Wno-sign-conversion)
- endif()
- # Unit Test Definition Macro
- # For now we need to disable the libc freeres. See https://github.com/open62541/open62541/pull/1003#issuecomment-315045143
- # This also requires to disable the phtread cache with no-nptl-pthread-stackcache
- set(VALGRIND_FLAGS --quiet --trace-children=yes --leak-check=full --run-libc-freeres=no --sim-hints=no-nptl-pthread-stackcache)
- macro(add_test_valgrind TEST_NAME)
- if(UA_ENABLE_VALGRIND_UNIT_TESTS)
- add_test(${TEST_NAME} valgrind --error-exitcode=1 --suppressions=${PROJECT_SOURCE_DIR}/tools/valgrind_suppressions.supp ${VALGRIND_FLAGS} ${ARGN})
- else()
- add_test(${TEST_NAME} ${ARGN})
- endif()
- endmacro()
- # the unit test are built directly on the open62541 object files. so they can
- # access symbols that are hidden/not exported to the shared library
- add_executable(check_types_builtin check_types_builtin.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
- target_link_libraries(check_types_builtin ${LIBS})
- 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_OBJECTS:open62541-testplugins>)
- target_link_libraries(check_types_memory ${LIBS})
- 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_OBJECTS:open62541-testplugins>)
- target_link_libraries(check_types_range ${LIBS})
- 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_OBJECTS:open62541-testplugins>)
- target_link_libraries(check_types_custom ${LIBS})
- add_test_valgrind(types_custom ${TESTS_BINARY_DIR}/check_types_custom)
- add_executable(check_chunking check_chunking.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
- target_link_libraries(check_chunking ${LIBS})
- add_test_valgrind(chunking ${TESTS_BINARY_DIR}/check_chunking)
- add_executable(check_utils check_utils.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
- target_link_libraries(check_utils ${LIBS})
- add_test_valgrind(check_utils ${TESTS_BINARY_DIR}/check_utils)
- # Test Server
- add_executable(check_accesscontrol check_accesscontrol.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
- target_link_libraries(check_accesscontrol ${LIBS})
- add_test_valgrind(check_accesscontrol ${TESTS_BINARY_DIR}/check_accesscontrol)
- add_executable(check_services_view check_services_view.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
- target_link_libraries(check_services_view ${LIBS})
- 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_OBJECTS:open62541-testplugins>)
- target_link_libraries(check_services_attributes ${LIBS})
- 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_OBJECTS:open62541-testplugins>)
- target_link_libraries(check_services_nodemanagement ${LIBS})
- 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_OBJECTS:open62541-testplugins>)
- target_link_libraries(check_services_subscriptions ${LIBS})
- add_test_valgrind(check_services_subscriptions ${TESTS_BINARY_DIR}/check_services_subscriptions)
- add_executable(check_nodestore check_nodestore.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
- target_link_libraries(check_nodestore ${LIBS})
- add_test_valgrind(nodestore ${TESTS_BINARY_DIR}/check_nodestore)
- add_executable(check_session check_session.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
- target_link_libraries(check_session ${LIBS})
- add_test_valgrind(session ${TESTS_BINARY_DIR}/check_session)
- add_executable(check_server_jobs check_server_jobs.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
- target_link_libraries(check_server_jobs ${LIBS})
- 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_OBJECTS:open62541-testplugins>)
- target_link_libraries(check_server_userspace ${LIBS})
- add_test_valgrind(check_server_userspace ${TESTS_BINARY_DIR}/check_server_userspace)
- if(UA_ENABLE_DISCOVERY)
- add_executable(check_discovery check_discovery.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
- target_link_libraries(check_discovery ${LIBS})
- add_test_valgrind(discovery ${TESTS_BINARY_DIR}/check_discovery)
- endif()
- # Readspeed server
- add_executable(check_server_readspeed check_server_readspeed.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
- target_link_libraries(check_server_readspeed ${LIBS})
- add_test_valgrind(check_server_readspeed ${TESTS_BINARY_DIR}/check_server_readspeed)
- # Test server with network dumps from files
- add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/client_HELOPN.bin
- ${CMAKE_CURRENT_BINARY_DIR}/client_CLO.bin
- ${CMAKE_CURRENT_BINARY_DIR}/client_CreateActivateSession.bin
- ${CMAKE_CURRENT_BINARY_DIR}/client_Browse.bin
- ${CMAKE_CURRENT_BINARY_DIR}/client_Read.bin
- ${CMAKE_CURRENT_BINARY_DIR}/client_Write.bin
- PRE_BUILD
- COMMAND python ${PROJECT_SOURCE_DIR}/tools/hex2bin.py
- ${CMAKE_CURRENT_SOURCE_DIR}/dumps/client_HELOPN.hex
- ${CMAKE_CURRENT_SOURCE_DIR}/dumps/client_CLO.hex
- ${CMAKE_CURRENT_SOURCE_DIR}/dumps/client_CreateActivateSession.hex
- ${CMAKE_CURRENT_SOURCE_DIR}/dumps/client_Browse.hex
- ${CMAKE_CURRENT_SOURCE_DIR}/dumps/client_Read.hex
- ${CMAKE_CURRENT_SOURCE_DIR}/dumps/client_Write.hex
- DEPENDS ${PROJECT_SOURCE_DIR}/tools/hex2bin.py
- ${CMAKE_CURRENT_SOURCE_DIR}/dumps/client_HELOPN.hex
- ${CMAKE_CURRENT_SOURCE_DIR}/dumps/client_CLO.hex
- ${CMAKE_CURRENT_SOURCE_DIR}/dumps/client_CreateActivateSession.hex
- ${CMAKE_CURRENT_SOURCE_DIR}/dumps/client_Browse.hex
- ${CMAKE_CURRENT_SOURCE_DIR}/dumps/client_Read.hex
- ${CMAKE_CURRENT_SOURCE_DIR}/dumps/client_Write.hex)
- add_custom_target(client_HELOPN.bin DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/client_HELOPN.bin")
- add_custom_target(client_CreateActivateSession.bin DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/client_CreateActivateSession.bin")
- add_executable(check_server_binary_messages check_server_binary_messages.c testing_networklayers.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
- target_include_directories(check_server_binary_messages PRIVATE ${PROJECT_SOURCE_DIR}/src/server)
- 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 ${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 ${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 ${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
- ${CMAKE_CURRENT_BINARY_DIR}/client_CLO.bin)
- # Test Client
- add_executable(check_client check_client.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
- target_link_libraries(check_client ${LIBS})
- add_test_valgrind(check_client ${TESTS_BINARY_DIR}/check_client)
- add_executable(check_client_async check_client_async.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
- target_link_libraries(check_client_async ${LIBS})
- add_test_valgrind(check_client_async ${TESTS_BINARY_DIR}/check_client_async)
- add_executable(check_client_subscriptions check_client_subscriptions.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
- target_link_libraries(check_client_subscriptions ${LIBS})
- add_test_valgrind(check_client_subscriptions ${TESTS_BINARY_DIR}/check_client_subscriptions)
- add_executable(check_client_highlevel check_client_highlevel.c $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
- target_link_libraries(check_client_highlevel ${LIBS})
- add_test_valgrind(check_client_highlevel ${TESTS_BINARY_DIR}/check_client_highlevel)
- #############################
- # #
- # Test for Nodeset Compiler #
- # #
- #############################
- # can only be tested if UA_ENABLE_FULL_NS0
- if (UA_ENABLE_FULL_NS0)
- file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/src_generated/tests")
- # Generate types for DI namespace
- set(UA_TYPES_OUT "ua_types_di")
- add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/tests/${UA_TYPES_OUT}_generated.c
- ${PROJECT_BINARY_DIR}/src_generated/tests/${UA_TYPES_OUT}_generated.h
- ${PROJECT_BINARY_DIR}/src_generated/tests/${UA_TYPES_OUT}_generated_handling.h
- ${PROJECT_BINARY_DIR}/src_generated/tests/${UA_TYPES_OUT}_generated_encoding_binary.h
- PRE_BUILD
- COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py
- --namespace=2
- --type-csv=${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/OpcUaDiModel.csv
- --type-bsd=${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.Types.bsd
- --no-builtin
- ${PROJECT_BINARY_DIR}/src_generated/tests/${UA_TYPES_OUT}
- DEPENDS ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py
- ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/OpcUaDiModel.csv
- ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.Types.bsd)
- add_custom_target(open62541-generator-tests-types-di DEPENDS ${PROJECT_BINARY_DIR}/src_generated/tests/${UA_TYPES_OUT}_generated.c)
- # Generate types for ADI namespace
- set(UA_TYPES_OUT "ua_types_adi")
- add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/tests/${UA_TYPES_OUT}_generated.c
- ${PROJECT_BINARY_DIR}/src_generated/tests/${UA_TYPES_OUT}_generated.h
- ${PROJECT_BINARY_DIR}/src_generated/tests/${UA_TYPES_OUT}_generated_handling.h
- ${PROJECT_BINARY_DIR}/src_generated/tests/${UA_TYPES_OUT}_generated_encoding_binary.h
- PRE_BUILD
- COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py
- --namespace=3
- --type-csv=${PROJECT_SOURCE_DIR}/deps/ua-nodeset/ADI/OpcUaAdiModel.csv
- --type-bsd=${PROJECT_SOURCE_DIR}/deps/ua-nodeset/ADI/Opc.Ua.Adi.Types.bsd
- --no-builtin
- ${PROJECT_BINARY_DIR}/src_generated/tests/${UA_TYPES_OUT}
- DEPENDS ${PROJECT_SOURCE_DIR}/tools/generate_datatypes.py
- ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/ADI/OpcUaAdiModel.csv
- ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/ADI/Opc.Ua.Adi.Types.bsd)
- add_custom_target(open62541-generator-tests-types-adi DEPENDS ${PROJECT_BINARY_DIR}/src_generated/tests/${UA_TYPES_OUT}_generated.c)
- # generate DI namespace
- add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/tests/ua_namespace_di.c
- ${PROJECT_BINARY_DIR}/src_generated/tests/ua_namespace_di.h
- PRE_BUILD
- COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset_compiler.py
- --internal-headers
- --types-array=UA_TYPES
- --types-array=UA_TYPES_DI
- --existing ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml
- --xml ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml
- ${PROJECT_BINARY_DIR}/src_generated/tests/ua_namespace_di
- DEPENDS ${UA_NAMESPACE0_XML}
- ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset_compiler.py
- ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodes.py
- ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset.py
- ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/datatypes.py
- ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541.py
- ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_nodes.py
- ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_datatypes.py
- ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml
- ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml
- )
- add_custom_target(open62541-generator-tests-ns-di DEPENDS ${PROJECT_BINARY_DIR}/src_generated/tests/ua_namespace_di.c)
- add_dependencies(open62541-generator-tests-ns-di open62541-generator-tests-types-di)
- # generate ADI namespace which is using DI
- add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/tests/ua_namespace_adi.c
- ${PROJECT_BINARY_DIR}/src_generated/tests/ua_namespace_adi.h
- PRE_BUILD
- COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset_compiler.py
- --internal-headers
- --types-array=UA_TYPES
- --types-array=UA_TYPES_DI
- --types-array=UA_TYPES_ADI
- --existing ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml
- --existing ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml
- --xml ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/ADI/Opc.Ua.Adi.NodeSet2.xml
- ${PROJECT_BINARY_DIR}/src_generated/tests/ua_namespace_adi
- DEPENDS ${UA_NAMESPACE0_XML}
- ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset_compiler.py
- ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodes.py
- ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset.py
- ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/datatypes.py
- ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541.py
- ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_nodes.py
- ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_datatypes.py
- ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml
- ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml
- ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/ADI/Opc.Ua.Adi.NodeSet2.xml
- )
- add_custom_target(open62541-generator-tests-ns-adi DEPENDS ${PROJECT_BINARY_DIR}/src_generated/tests/ua_namespace_adi.c)
- add_dependencies(open62541-generator-tests-ns-adi open62541-generator-tests-types-adi open62541-generator-tests-ns-di)
- # generate PLCopen namespace which is using DI
- add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/tests/ua_namespace_plc.c
- ${PROJECT_BINARY_DIR}/src_generated/tests/ua_namespace_plc.h
- PRE_BUILD
- COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset_compiler.py
- --internal-headers
- --types-array=UA_TYPES
- --types-array=UA_TYPES_DI
- # PLCopen has no specific type definition, thus use the default UA_TYPES to ignore it
- --types-array=UA_TYPES
- --existing ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml
- --existing ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml
- --xml ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/PLCopen/Opc.Ua.Plc.NodeSet2.xml
- ${PROJECT_BINARY_DIR}/src_generated/tests/ua_namespace_plc
- DEPENDS ${UA_NAMESPACE0_XML}
- ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset_compiler.py
- ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodes.py
- ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/nodeset.py
- ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/datatypes.py
- ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541.py
- ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_nodes.py
- ${PROJECT_SOURCE_DIR}/tools/nodeset_compiler/backend_open62541_datatypes.py
- ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml
- ${PROJECT_SOURCE_DIR}/deps/ua-nodeset/PLCopen/Opc.Ua.Plc.NodeSet2.xml
- )
- add_custom_target(open62541-generator-tests-ns-plc DEPENDS ${PROJECT_BINARY_DIR}/src_generated/tests/ua_namespace_plc.c)
- add_dependencies(open62541-generator-tests-ns-plc open62541-generator-tests-ns-di)
- add_executable(check_nodeset_compiler_adi
- check_nodeset_compiler_adi.c
- ${PROJECT_BINARY_DIR}/src_generated/tests/ua_types_di_generated.c
- ${PROJECT_BINARY_DIR}/src_generated/tests/ua_namespace_di.c
- ${PROJECT_BINARY_DIR}/src_generated/tests/ua_types_adi_generated.c
- ${PROJECT_BINARY_DIR}/src_generated/tests/ua_namespace_adi.c
- $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
- add_dependencies(check_nodeset_compiler_adi open62541-generator-tests-ns-adi)
- target_link_libraries(check_nodeset_compiler_adi ${LIBS})
- add_test_valgrind(check_nodeset_compiler_adi ${TESTS_BINARY_DIR}/check_nodeset_compiler_adi)
- add_executable(check_nodeset_compiler_plc
- check_nodeset_compiler_plc.c
- ${PROJECT_BINARY_DIR}/src_generated/tests/ua_types_di_generated.c
- ${PROJECT_BINARY_DIR}/src_generated/tests/ua_namespace_di.c
- ${PROJECT_BINARY_DIR}/src_generated/tests/ua_namespace_plc.c
- $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
- add_dependencies(check_nodeset_compiler_plc open62541-generator-tests-ns-plc)
- target_link_libraries(check_nodeset_compiler_plc ${LIBS})
- add_test_valgrind(check_nodeset_compiler_plc ${TESTS_BINARY_DIR}/check_nodeset_compiler_plc)
- endif()
|