Skip to content

Commit

Permalink
Add ddsrecorder_tool tests
Browse files Browse the repository at this point in the history
Signed-off-by: Irene Bandera <irenebandera@eprosima.com>
  • Loading branch information
irenebm committed Jan 23, 2024
1 parent 4602393 commit 97bf976
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
15 changes: 5 additions & 10 deletions ddsrecorder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,31 +62,26 @@ configure_project_cpp()

# Determine Fast DDS version
if ("${fastrtps_VERSION}" VERSION_LESS 2.13)
set(DDS_TYPES_VERSION "/v1/")
set(DDS_TYPES_VERSION "v1")
else()
set(DDS_TYPES_VERSION "/v2/")
set(DDS_TYPES_VERSION "v2")
endif()

file(
GLOB_RECURSE SOURCES_FILES
"${PROJECT_SOURCE_DIR}/src/cpp/tool/*.cpp"
"${PROJECT_SOURCE_DIR}/src/cpp/user_interface/*.cpp"
"${PROJECT_SOURCE_DIR}/src/cpp/main.cpp"
"${PROJECT_SOURCE_DIR}/src/cpp/command_receiver/*.cpp"
"${PROJECT_SOURCE_DIR}/src/cpp/**/**${DDS_TYPES_VERSION}**/*.cxx"
"${PROJECT_SOURCE_DIR}/src/cpp/command_receiver/Command*.cpp"
"${PROJECT_SOURCE_DIR}/src/cpp/*/*/${DDS_TYPES_VERSION}/*/*.cxx"
)

compile_tool(
"${PROJECT_SOURCE_DIR}/src/cpp/" # Source directory
"${SOURCES_FILES}"
)

file(GLOB_RECURSE TEST_FILES "${PROJECT_SOURCE_DIR}/test/")
foreach(TEST_FILE ${TEST_FILES})
if(NOT TEST_FILE MATCHES ${DDS_TYPES_VERSION})
compile_test_tool(${TEST_FILE})
endif()
endforeach()
compile_test_tool("${PROJECT_SOURCE_DIR}/test/")

###############################################################################
# Packaging
Expand Down
11 changes: 10 additions & 1 deletion ddsrecorder/test/blackbox/mcap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,21 @@ else()
set(DDS_TYPES_VERSION "v2")
endif()

file(
GLOB_RECURSE TEST_LIBRARY_SOURCES
"${PROJECT_SOURCE_DIR}/src/cpp/tool/*.cpp"
"${PROJECT_SOURCE_DIR}/src/cpp/user_interface/*.cpp"
"${PROJECT_SOURCE_DIR}/src/cpp/command_receiver/Command*.cpp"
"${PROJECT_SOURCE_DIR}/src/cpp/*/*/${DDS_TYPES_VERSION}/*/*.cxx"
)

set(TEST_SOURCES
McapFileCreationTest.cpp
${PROJECT_SOURCE_DIR}/test/blackbox/mcap/types/${DDS_TYPES_VERSION}/hello_world/HelloWorld.cxx
${PROJECT_SOURCE_DIR}/test/blackbox/mcap/types/${DDS_TYPES_VERSION}/hello_world/HelloWorldPubSubTypes.cxx
${PROJECT_SOURCE_DIR}/test/blackbox/mcap/types/${DDS_TYPES_VERSION}/hello_world/HelloWorldTypeObject.cxx
$<$<STREQUAL:${DDS_TYPES_VERSION},v2>:${PROJECT_SOURCE_DIR}/test/blackbox/mcap/types/v2/hello_world/HelloWorldv1.cxx>
)
)

set(TEST_LIST
mcap_data_msgs
Expand Down Expand Up @@ -75,4 +83,5 @@ add_blackbox_executable(
"${TEST_LIST}"
"${TEST_NEEDED_SOURCES}"
"${TEST_EXTRA_HEADERS}"
"${TEST_LIBRARY_SOURCES}"
)

0 comments on commit 97bf976

Please sign in to comment.