Skip to content

Commit

Permalink
refactor(build): Simplify the structure of the nodeset-loader tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfr committed Dec 9, 2023
1 parent b43f2e7 commit 468070f
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 39 deletions.
38 changes: 29 additions & 9 deletions tests/nodeset-loader/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
####################################################
# Test nodeset loader on a subset of nodeset files #
####################################################

add_compile_definitions(OPEN62541_NODESET_DIR="${UA_NODESET_DIR}/")
ua_add_test(check_nodeset_loader_di.c)
ua_add_test(check_nodeset_loader_autoid.c)
Expand All @@ -22,12 +18,11 @@ if(UA_NAMESPACE_ZERO STREQUAL "FULL")
NAMESPACE_MAP "2:http://opcfoundation.org/UA/DI/"
OUTPUT_DIR "${GENERATE_OUTPUT_DIR}"
FILE_NS "${UA_NODESET_DIR}/DI/Opc.Ua.Di.NodeSet2.xml"
INTERNAL
)
INTERNAL)

add_executable(check_nodeset_loader_compare_di check_nodeset_loader_compare_di.c
${UA_NODESET_NODESETLOADER_DI_SOURCES} ${UA_TYPES_NODESETLOADER_DI_SOURCES}
$<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-plugins>)
$<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-plugins> $<TARGET_OBJECTS:open62541-testplugins>)
add_dependencies(check_nodeset_loader_compare_di open62541-generator-ns-nodesetloader-di)
target_link_libraries(check_nodeset_loader_compare_di ${LIBS})
add_test_valgrind(check_nodeset_loader_compare_di ${TESTS_BINARY_DIR}/check_nodeset_loader_compare_di)
Expand All @@ -37,6 +32,31 @@ if(UA_NAMESPACE_ZERO STREQUAL "FULL")

add_compile_definitions(OPEN62541_ORDERING_DIR="${CMAKE_BINARY_DIR}/../deps/nodesetLoader/nodesets/open62541/")
ua_add_test(check_nodeset_loader_ordering_di.c)
endif()

add_subdirectory(add_node_integration_test)
#####################
# Integration tests #
#####################

add_executable(add_node_integration_test_client client.c
$<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-plugins> $<TARGET_OBJECTS:open62541-testplugins>)
set_target_properties(add_node_integration_test_client PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
target_link_libraries(add_node_integration_test_client ${LIBS})

add_executable(add_node_integration_test_server server.c
$<TARGET_OBJECTS:open62541-object> $<TARGET_OBJECTS:open62541-plugins> $<TARGET_OBJECTS:open62541-testplugins>)
set_target_properties(add_node_integration_test_server PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
target_link_libraries(add_node_integration_test_server ${LIBS})

find_program(BASH_PROGRAM bash)

add_test(check_nodeset_loader_add_node_integration
${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/run_test.sh
"${CMAKE_CURRENT_BINARY_DIR}/add_node_integration_test_client"
"${CMAKE_CURRENT_BINARY_DIR}/add_node_integration_test_server")

add_test(check_nodeset_loader_DI_ordering_integration
${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/run_test_ordering.sh
"${CMAKE_CURRENT_BINARY_DIR}/add_node_integration_test_client"
"${CMAKE_CURRENT_BINARY_DIR}/add_node_integration_test_server")

endif()
29 changes: 0 additions & 29 deletions tests/nodeset-loader/add_node_integration_test/CMakeLists.txt

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function add_node_integration_test() {
NodeIdFiles=()
}

UA_NODESET_PATH=$SCRIPT_DIR/../../../deps/ua-nodeset
UA_NODESET_PATH=$SCRIPT_DIR/../../deps/ua-nodeset

add_node_integration_test "ADI" \
$UA_NODESET_PATH/DI/Opc.Ua.Di.NodeSet2.xml \
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 468070f

Please sign in to comment.