Skip to content

Commit

Permalink
Fix communication tests not run (#3614)
Browse files Browse the repository at this point in the history
* Refs #19054: Fix communication tests not runned

Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>

* Refs #19054: Clean before running the test

Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com>

* Refs #19054: Make test_wrapper.cmake a configurable file

Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com>

* Refs #19054: Fix missing python path

Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>

---------

Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>
Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com>
Co-authored-by: Eduardo Ponz <eduardoponz@eprosima.com>
  • Loading branch information
JesusPoderoso and EduPonz authored Jun 27, 2023
1 parent ab54e17 commit 394d2d1
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 16 deletions.
5 changes: 0 additions & 5 deletions cmake/common/test_wrapper.cmake

This file was deleted.

8 changes: 8 additions & 0 deletions cmake/common/test_wrapper.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
find_package(PythonInterp 3)

# Clean first so the exit code comes from the second process
message(STATUS "test_wrapper - Running command: ${PYTHON_EXECUTABLE} @PROJECT_BINARY_DIR@/tools/fastdds/fastdds.py shm clean")
execute_process(COMMAND ${PYTHON_EXECUTABLE} @PROJECT_BINARY_DIR@/tools/fastdds/fastdds.py shm clean)

message(STATUS "test_wrapper - Running command: ${ACTUAL_TEST} ${ACTUAL_ARGS}")
execute_process(COMMAND ${ACTUAL_TEST} ${ACTUAL_ARGS})
24 changes: 13 additions & 11 deletions test/communication/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/simple_secure_allow_unauthenticated_p
${CMAKE_CURRENT_BINARY_DIR}/simple_secure_allow_unauthenticated_pub_profile.xml COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/simple_allow_unauthenticated_sub_profile.xml
${CMAKE_CURRENT_BINARY_DIR}/simple_allow_unauthenticated_sub_profile.xml COPYONLY)
configure_file(${PROJECT_SOURCE_DIR}/cmake/common/test_wrapper.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake @ONLY)

if(SECURITY)
configure_file(${PROJECT_SOURCE_DIR}/test/certs/maincacert.pem
Expand Down Expand Up @@ -198,7 +200,7 @@ endif()

if(PYTHONINTERP_FOUND)
add_test(NAME SimpleCommunicationBestEffort
COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST="${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py" -P ${PROJECT_SOURCE_DIR}/cmake/common/test_wrapper.cmake)
COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${PYTHON_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake)

# Set test with label NoMemoryCheck
set_property(TEST SimpleCommunicationBestEffort PROPERTY LABELS "NoMemoryCheck")
Expand All @@ -216,7 +218,7 @@ if(PYTHONINTERP_FOUND)
endif()

add_test(NAME SimpleCommunicationReliable
COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST="${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py" -P ${PROJECT_SOURCE_DIR}/cmake/common/test_wrapper.cmake)
COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${PYTHON_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake)

# Set test with label NoMemoryCheck
set_property(TEST SimpleCommunicationReliable PROPERTY LABELS "NoMemoryCheck")
Expand All @@ -234,7 +236,7 @@ if(PYTHONINTERP_FOUND)
endif()

add_test(NAME SimpleCommunicationReliableBestEffort
COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST="${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py" -P ${PROJECT_SOURCE_DIR}/cmake/common/test_wrapper.cmake)
COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${PYTHON_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake)

# Set test with label NoMemoryCheck
set_property(TEST SimpleCommunicationReliableBestEffort PROPERTY LABELS "NoMemoryCheck")
Expand All @@ -252,7 +254,7 @@ if(PYTHONINTERP_FOUND)
endif()

add_test(NAME SimpleMixCommunicationBestEffort
COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST="${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_mix_communication.py" -P ${PROJECT_SOURCE_DIR}/cmake/common/test_wrapper.cmake)
COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${PYTHON_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/simple_mix_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake)

# Set test with label NoMemoryCheck
set_property(TEST SimpleMixCommunicationBestEffort PROPERTY LABELS "NoMemoryCheck")
Expand All @@ -270,7 +272,7 @@ if(PYTHONINTERP_FOUND)
endif()

add_test(NAME SimpleMixCommunicationReliable
COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST="${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_mix_communication.py" -P ${PROJECT_SOURCE_DIR}/cmake/common/test_wrapper.cmake)
COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${PYTHON_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/simple_mix_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake)

# Set test with label NoMemoryCheck
set_property(TEST SimpleMixCommunicationReliable PROPERTY LABELS "NoMemoryCheck")
Expand All @@ -289,7 +291,7 @@ if(PYTHONINTERP_FOUND)

if(SECURITY)
add_test(NAME SimpleCommunicationSecureBestEffort
COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST="${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py" -P ${PROJECT_SOURCE_DIR}/cmake/common/test_wrapper.cmake)
COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${PYTHON_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake)

# Set test with label NoMemoryCheck
set_property(TEST SimpleCommunicationSecureBestEffort PROPERTY LABELS "NoMemoryCheck")
Expand Down Expand Up @@ -538,7 +540,7 @@ if(PYTHONINTERP_FOUND)
endif()

add_test(NAME LivelinessAssertion
COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST="${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/liveliness_assertion.py" -P ${PROJECT_SOURCE_DIR}/cmake/common/test_wrapper.cmake)
COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${PYTHON_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/liveliness_assertion.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake)

# Set test with label NoMemoryCheck
set_property(TEST LivelinessAssertion PROPERTY LABELS "NoMemoryCheck")
Expand All @@ -553,7 +555,7 @@ if(PYTHONINTERP_FOUND)
"PATH=$<TARGET_FILE_DIR:${PROJECT_NAME}>\\;$<TARGET_FILE_DIR:fastcdr>\\;${WIN_PATH}")
endif()
add_test(NAME AutomaticLivelinessAssertion
COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST="${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/automatic_liveliness_assertion.py" -P ${PROJECT_SOURCE_DIR}/cmake/common/test_wrapper.cmake)
COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${PYTHON_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/automatic_liveliness_assertion.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake)

# Set test with label NoMemoryCheck
set_property(TEST AutomaticLivelinessAssertion PROPERTY LABELS "NoMemoryCheck")
Expand All @@ -569,7 +571,7 @@ if(PYTHONINTERP_FOUND)
endif()

add_test(NAME TwoPublishersCommunicationBestEffort
COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST="${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/two_publishers_communication.py" -P ${PROJECT_SOURCE_DIR}/cmake/common/test_wrapper.cmake)
COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${PYTHON_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/two_publishers_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake)

# Set test with label NoMemoryCheck
set_property(TEST TwoPublishersCommunicationBestEffort PROPERTY LABELS "NoMemoryCheck")
Expand Down Expand Up @@ -605,7 +607,7 @@ if(PYTHONINTERP_FOUND)
endif()

add_test(NAME SimpleCommunicationBestEffortFixed
COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST="${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py" -P ${PROJECT_SOURCE_DIR}/cmake/common/test_wrapper.cmake)
COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${PYTHON_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake)

# Set test with label NoMemoryCheck
set_property(TEST SimpleCommunicationBestEffortFixed PROPERTY LABELS "NoMemoryCheck")
Expand All @@ -627,7 +629,7 @@ if(PYTHONINTERP_FOUND)
endif()

add_test(NAME SHMCommunicationSubscriberDiesWhileProcessingMessage
COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST="${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/shm_communication_subscriber_dies_while_processing_message.py" -P ${PROJECT_SOURCE_DIR}/cmake/common/test_wrapper.cmake)
COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${PYTHON_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/shm_communication_subscriber_dies_while_processing_message.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake)

# Set test with label NoMemoryCheck
set_property(TEST SHMCommunicationSubscriberDiesWhileProcessingMessage PROPERTY LABELS "NoMemoryCheck")
Expand Down
13 changes: 13 additions & 0 deletions tools/fastdds/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@
# empty LANGUAGES defaults to C in Ubuntu and breaks the build
project(fastdds-tool LANGUAGES CXX)

# copy fastdds.py in build dir
if(EPROSIMA_BUILD)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fastdds.py
${CMAKE_CURRENT_BINARY_DIR}/fastdds.py COPYONLY)

file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/discovery
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/shm
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/xml_ci
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
endif()

###############################################################################
# Installation
###############################################################################
Expand Down

0 comments on commit 394d2d1

Please sign in to comment.