123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/src_generated/tests")
- include_directories("${PROJECT_BINARY_DIR}/src_generated/tests")
- ###############################################
- # Test Companion Specs that need the full NS0 #
- ###############################################
- if(UA_NAMESPACE_ZERO STREQUAL "FULL")
- # Generate types for DI namespace
- ua_generate_datatypes(
- NAME "ua_types_di"
- TARGET_SUFFIX "tests-types-di"
- NAMESPACE_IDX 2
- OUTPUT_DIR "${PROJECT_BINARY_DIR}/src_generated/tests"
- FILE_CSV "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/OpcUaDiModel.csv"
- FILES_BSD "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.Types.bsd"
- )
- # Generate types for ADI namespace
- ua_generate_datatypes(
- NAME "ua_types_adi"
- TARGET_SUFFIX "tests-types-adi"
- NAMESPACE_IDX 3
- OUTPUT_DIR "${PROJECT_BINARY_DIR}/src_generated/tests"
- FILE_CSV "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/ADI/OpcUaAdiModel.csv"
- FILES_BSD "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/ADI/Opc.Ua.Adi.Types.bsd"
- )
- # generate DI namespace
- ua_generate_nodeset(
- NAME "tests-di"
- FILE "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml"
- TYPES_ARRAY "UA_TYPES_DI"
- INTERNAL
- OUTPUT_DIR "${PROJECT_BINARY_DIR}/src_generated/tests"
- DEPENDS_TYPES "UA_TYPES"
- DEPENDS_NS "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml"
- DEPENDS_TARGET "open62541-generator-tests-types-di"
- )
- # generate PLCopen namespace which is using DI
- ua_generate_nodeset(
- NAME "tests-adi"
- FILE "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/ADI/Opc.Ua.Adi.NodeSet2.xml"
- TYPES_ARRAY "UA_TYPES_ADI"
- INTERNAL
- OUTPUT_DIR "${PROJECT_BINARY_DIR}/src_generated/tests"
- DEPENDS_TYPES
- "UA_TYPES" "UA_TYPES_DI"
- DEPENDS_NS
- "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml"
- "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml"
- DEPENDS_TARGET "open62541-generator-ns-tests-di" "open62541-generator-tests-types-adi"
- )
- # generate PLCopen namespace which is using DI
- ua_generate_nodeset(
- NAME "tests-plc"
- FILE "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/PLCopen/Opc.Ua.Plc.NodeSet2.xml"
- INTERNAL
- OUTPUT_DIR "${PROJECT_BINARY_DIR}/src_generated/tests"
- DEPENDS_TYPES
- "UA_TYPES" "UA_TYPES_DI"
- DEPENDS_NS
- "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml"
- "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml"
- DEPENDS_TARGET "open62541-generator-ns-tests-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_tests_di.c
- ${PROJECT_BINARY_DIR}/src_generated/tests/ua_types_adi_generated.c
- ${PROJECT_BINARY_DIR}/src_generated/tests/ua_namespace_tests_adi.c
- $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
- add_dependencies(check_nodeset_compiler_adi open62541-generator-ns-tests-adi)
- target_link_libraries(check_nodeset_compiler_adi ${LIBS})
- add_test_valgrind(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_tests_di.c
- ${PROJECT_BINARY_DIR}/src_generated/tests/ua_namespace_tests_plc.c
- $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
- add_dependencies(check_nodeset_compiler_plc open62541-generator-ns-tests-plc)
- target_link_libraries(check_nodeset_compiler_plc ${LIBS})
- add_test_valgrind(nodeset_compiler_plc ${TESTS_BINARY_DIR}/check_nodeset_compiler_plc)
-
- endif()
- #generate testnodeset
- if(UA_NAMESPACE_ZERO STREQUAL "FULL")
-
- ua_generate_datatypes(
- NAME "ua_types_testnodeset"
- TARGET_SUFFIX "tests-types-testnodeset"
- NAMESPACE_IDX 2
- OUTPUT_DIR "${PROJECT_BINARY_DIR}/src_generated/tests"
- FILE_CSV "${PROJECT_SOURCE_DIR}/tests/nodeset-compiler/testnodeset.csv"
- FILES_BSD "${PROJECT_SOURCE_DIR}/tests/nodeset-compiler/testtypes.bsd"
- )
-
- ua_generate_nodeset(
- NAME "tests-testnodeset"
- FILE "${PROJECT_SOURCE_DIR}/tests/nodeset-compiler/testnodeset.xml"
- TYPES_ARRAY "UA_TYPES_TESTNODESET"
- INTERNAL
- OUTPUT_DIR "${PROJECT_BINARY_DIR}/src_generated/tests"
- DEPENDS_TYPES "UA_TYPES"
- DEPENDS_NS "${PROJECT_SOURCE_DIR}/deps/ua-nodeset/Schema/Opc.Ua.NodeSet2.xml"
- DEPENDS_TARGET "open62541-generator-tests-types-testnodeset"
- )
- add_executable(check_nodeset_compiler_testnodeset check_nodeset_compiler_testnodeset.c
- ${PROJECT_BINARY_DIR}/src_generated/tests/ua_namespace_tests_testnodeset.c
- ${PROJECT_BINARY_DIR}/src_generated/tests/ua_types_testnodeset_generated.c
- $<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-testplugins>)
- add_dependencies(check_nodeset_compiler_testnodeset open62541-generator-ns-tests-testnodeset)
- target_link_libraries(check_nodeset_compiler_testnodeset ${LIBS})
- add_test_valgrind(nodeset_compiler_testnodeset ${TESTS_BINARY_DIR}/check_nodeset_compiler_testnodeset)
- endif()
|