diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 44328183165..128f2fa380e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -30,9 +30,7 @@ set(MEMORYCHECK_SUPPRESSIONS_FILE ${MEMORYCHECK_SUPPRESSIONS_FILE_TMP} CACHE FIL ############################################################################### if(EPROSIMA_BUILD_TESTS AND IS_TOP_LEVEL AND NOT EPROSIMA_INSTALLER) find_package(GTest CONFIG REQUIRED) - if (GTest_FOUND) - include(${PROJECT_SOURCE_DIR}/cmake/common/gtest.cmake) - endif() + include(${PROJECT_SOURCE_DIR}/cmake/common/gtest.cmake) add_subdirectory(blackbox) add_subdirectory(communication) diff --git a/test/blackbox/CMakeLists.txt b/test/blackbox/CMakeLists.txt index c6e85d654e2..01e8e7a2583 100644 --- a/test/blackbox/CMakeLists.txt +++ b/test/blackbox/CMakeLists.txt @@ -158,182 +158,180 @@ option(FASTRTPS_API_TESTS "Enable tests using FastRTPS API" ON) option(FASTDDS_PIM_API_TESTS "Enable tests using FastDDS API" OFF) if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER) AND fastcdr_FOUND) - if(GTest_FOUND) - if(WIN32) - add_definitions( - -D_WIN32_WINNT=0x0601 - -D_CRT_SECURE_NO_WARNINGS - ) - endif() + if(WIN32) + add_definitions( + -D_WIN32_WINNT=0x0601 + -D_CRT_SECURE_NO_WARNINGS + ) + endif() - ############################################################################### - # Unit tests - ############################################################################### - file(GLOB RTPS_BLACKBOXTESTS_TEST_SOURCE "common/RTPSBlackboxTests*.cpp") - set(RTPS_BLACKBOXTESTS_SOURCE ${RTPS_BLACKBOXTESTS_TEST_SOURCE} - types/HelloWorld.cpp - types/HelloWorldType.cpp - types/KeyedHelloWorld.cpp - types/KeyedHelloWorldType.cpp - types/String.cpp - types/StringType.cpp - types/Data64kb.cpp - types/Data64kbType.cpp - types/Data1mb.cpp - types/Data1mbType.cpp - types/FixedSized.cpp - types/FixedSizedType.cpp - - utils/data_generators.cpp - utils/lambda_functions.cpp - utils/print_functions.cpp + ############################################################################### + # Unit tests + ############################################################################### + file(GLOB RTPS_BLACKBOXTESTS_TEST_SOURCE "common/RTPSBlackboxTests*.cpp") + set(RTPS_BLACKBOXTESTS_SOURCE ${RTPS_BLACKBOXTESTS_TEST_SOURCE} + types/HelloWorld.cpp + types/HelloWorldType.cpp + types/KeyedHelloWorld.cpp + types/KeyedHelloWorldType.cpp + types/String.cpp + types/StringType.cpp + types/Data64kb.cpp + types/Data64kbType.cpp + types/Data1mb.cpp + types/Data1mbType.cpp + types/FixedSized.cpp + types/FixedSizedType.cpp + + utils/data_generators.cpp + utils/lambda_functions.cpp + utils/print_functions.cpp + ) + add_executable(BlackboxTests_RTPS ${RTPS_BLACKBOXTESTS_SOURCE}) + target_compile_definitions(BlackboxTests_RTPS PRIVATE + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + $<$>:FASTDDS_SHM_TRANSPORT_DISABLED> # Do not compile SHM Transport + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(BlackboxTests_RTPS PRIVATE + ${Asio_INCLUDE_DIR}) + target_link_libraries(BlackboxTests_RTPS fastrtps fastcdr foonathan_memory GTest::gtest) + add_blackbox_gtest(BlackboxTests_RTPS SOURCES ${RTPS_BLACKBOXTESTS_TEST_SOURCE}) + + file(GLOB BLACKBOXTESTS_TEST_SOURCE "common/BlackboxTests*.cpp") + set(BLACKBOXTESTS_SOURCE ${BLACKBOXTESTS_TEST_SOURCE} + types/HelloWorld.cpp + types/HelloWorldType.cpp + types/KeyedHelloWorld.cpp + types/KeyedHelloWorldType.cpp + types/String.cpp + types/StringType.cpp + types/Data64kb.cpp + types/Data64kbType.cpp + types/Data1mb.cpp + types/Data1mbType.cpp + types/FixedSized.cpp + types/FixedSizedType.cpp + + utils/data_generators.cpp + utils/lambda_functions.cpp + utils/print_functions.cpp + + common/TCPReqRepHelloWorldRequester.cpp + common/TCPReqRepHelloWorldReplier.cpp + ) + + file(GLOB DDS_BLACKBOXTESTS_TEST_SOURCE "common/DDSBlackboxTests*.cpp") + set(DDS_BLACKBOXTESTS_SOURCE + ${DDS_BLACKBOXTESTS_TEST_SOURCE} + ${BLACKBOXTESTS_SOURCE} + ) + + # Prepare static discovery xml file for blackbox tests. + string(RANDOM LENGTH 4 ALPHABET 0123456789 TOPIC_RANDOM_NUMBER) + math(EXPR TOPIC_RANDOM_NUMBER "${TOPIC_RANDOM_NUMBER} + 0") # Remove extra leading 0s. + string(RANDOM LENGTH 4 ALPHABET 0123456789 W_UNICAST_PORT_RANDOM_NUMBER) + math(EXPR W_UNICAST_PORT_RANDOM_NUMBER "${W_UNICAST_PORT_RANDOM_NUMBER} + 0") # Remove extra leading 0s. + if(W_UNICAST_PORT_RANDOM_NUMBER LESS 1025) + math(EXPR W_UNICAST_PORT_RANDOM_NUMBER "${W_UNICAST_PORT_RANDOM_NUMBER} + 1024") # Remove extra leading 0s. + endif() + math(EXPR R_UNICAST_PORT_RANDOM_NUMBER "${W_UNICAST_PORT_RANDOM_NUMBER} + 1") + math(EXPR MULTICAST_PORT_RANDOM_NUMBER "${R_UNICAST_PORT_RANDOM_NUMBER} + 1") + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/PubSubWriter.xml.in + ${CMAKE_CURRENT_BINARY_DIR}/PubSubWriter.xml) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/PubSubReader.xml.in + ${CMAKE_CURRENT_BINARY_DIR}/PubSubReader.xml) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/discovery_participant_flags.xml + ${CMAKE_CURRENT_BINARY_DIR}/discovery_participant_flags.xml) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/persistence.xml + ${CMAKE_CURRENT_BINARY_DIR}/persistence.xml) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/StatisticsDomainParticipant.xml + ${CMAKE_CURRENT_BINARY_DIR}/StatisticsDomainParticipant.xml) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/utils/check_guid.py + ${CMAKE_CURRENT_BINARY_DIR}/check_guid.py) + + if(FASTRTPS_API_TESTS) + set(BLACKBOXTESTS_FASTRTPS_SOURCE + ${BLACKBOXTESTS_SOURCE} + api/fastrtps_deprecated/ReqRepHelloWorldRequester.cpp + api/fastrtps_deprecated/ReqRepHelloWorldReplier.cpp ) - add_executable(BlackboxTests_RTPS ${RTPS_BLACKBOXTESTS_SOURCE}) - target_compile_definitions(BlackboxTests_RTPS PRIVATE + + add_executable(BlackboxTests_FastRTPS ${BLACKBOXTESTS_FASTRTPS_SOURCE}) + target_compile_definitions(BlackboxTests_FastRTPS PRIVATE BOOST_ASIO_STANDALONE ASIO_STANDALONE $<$>:FASTDDS_SHM_TRANSPORT_DISABLED> # Do not compile SHM Transport $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) - target_include_directories(BlackboxTests_RTPS PRIVATE - ${Asio_INCLUDE_DIR}) - target_link_libraries(BlackboxTests_RTPS fastrtps fastcdr foonathan_memory GTest::gtest) - add_blackbox_gtest(BlackboxTests_RTPS SOURCES ${RTPS_BLACKBOXTESTS_TEST_SOURCE}) - - file(GLOB BLACKBOXTESTS_TEST_SOURCE "common/BlackboxTests*.cpp") - set(BLACKBOXTESTS_SOURCE ${BLACKBOXTESTS_TEST_SOURCE} - types/HelloWorld.cpp - types/HelloWorldType.cpp - types/KeyedHelloWorld.cpp - types/KeyedHelloWorldType.cpp - types/String.cpp - types/StringType.cpp - types/Data64kb.cpp - types/Data64kbType.cpp - types/Data1mb.cpp - types/Data1mbType.cpp - types/FixedSized.cpp - types/FixedSizedType.cpp - - utils/data_generators.cpp - utils/lambda_functions.cpp - utils/print_functions.cpp - - common/TCPReqRepHelloWorldRequester.cpp - common/TCPReqRepHelloWorldReplier.cpp + target_include_directories(BlackboxTests_FastRTPS PRIVATE + ${Asio_INCLUDE_DIR} + api/fastrtps_deprecated) + target_link_libraries(BlackboxTests_FastRTPS fastrtps fastcdr foonathan_memory GTest::gtest) + add_blackbox_gtest(BlackboxTests_FastRTPS SOURCES ${BLACKBOXTESTS_TEST_SOURCE} + ENVIRONMENTS "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs" + "TOPIC_RANDOM_NUMBER=${TOPIC_RANDOM_NUMBER}" + "W_UNICAST_PORT_RANDOM_NUMBER=${W_UNICAST_PORT_RANDOM_NUMBER}" + "R_UNICAST_PORT_RANDOM_NUMBER=${R_UNICAST_PORT_RANDOM_NUMBER}" + "MULTICAST_PORT_RANDOM_NUMBER=${MULTICAST_PORT_RANDOM_NUMBER}" ) + endif(FASTRTPS_API_TESTS) - file(GLOB DDS_BLACKBOXTESTS_TEST_SOURCE "common/DDSBlackboxTests*.cpp") - set(DDS_BLACKBOXTESTS_SOURCE - ${DDS_BLACKBOXTESTS_TEST_SOURCE} - ${BLACKBOXTESTS_SOURCE} + if(FASTDDS_PIM_API_TESTS) + set(BLACKBOXTESTS_FASTDDS_PIM_SOURCE + ${DDS_BLACKBOXTESTS_SOURCE} + api/dds-pim/ReqRepHelloWorldRequester.cpp + api/dds-pim/ReqRepHelloWorldReplier.cpp ) - # Prepare static discovery xml file for blackbox tests. - string(RANDOM LENGTH 4 ALPHABET 0123456789 TOPIC_RANDOM_NUMBER) - math(EXPR TOPIC_RANDOM_NUMBER "${TOPIC_RANDOM_NUMBER} + 0") # Remove extra leading 0s. - string(RANDOM LENGTH 4 ALPHABET 0123456789 W_UNICAST_PORT_RANDOM_NUMBER) - math(EXPR W_UNICAST_PORT_RANDOM_NUMBER "${W_UNICAST_PORT_RANDOM_NUMBER} + 0") # Remove extra leading 0s. - if(W_UNICAST_PORT_RANDOM_NUMBER LESS 1025) - math(EXPR W_UNICAST_PORT_RANDOM_NUMBER "${W_UNICAST_PORT_RANDOM_NUMBER} + 1024") # Remove extra leading 0s. - endif() - math(EXPR R_UNICAST_PORT_RANDOM_NUMBER "${W_UNICAST_PORT_RANDOM_NUMBER} + 1") - math(EXPR MULTICAST_PORT_RANDOM_NUMBER "${R_UNICAST_PORT_RANDOM_NUMBER} + 1") - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/PubSubWriter.xml.in - ${CMAKE_CURRENT_BINARY_DIR}/PubSubWriter.xml) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/PubSubReader.xml.in - ${CMAKE_CURRENT_BINARY_DIR}/PubSubReader.xml) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/discovery_participant_flags.xml - ${CMAKE_CURRENT_BINARY_DIR}/discovery_participant_flags.xml) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/persistence.xml - ${CMAKE_CURRENT_BINARY_DIR}/persistence.xml) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/StatisticsDomainParticipant.xml - ${CMAKE_CURRENT_BINARY_DIR}/StatisticsDomainParticipant.xml) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/utils/check_guid.py - ${CMAKE_CURRENT_BINARY_DIR}/check_guid.py) - - if(FASTRTPS_API_TESTS) - set(BLACKBOXTESTS_FASTRTPS_SOURCE - ${BLACKBOXTESTS_SOURCE} - api/fastrtps_deprecated/ReqRepHelloWorldRequester.cpp - api/fastrtps_deprecated/ReqRepHelloWorldReplier.cpp - ) - - add_executable(BlackboxTests_FastRTPS ${BLACKBOXTESTS_FASTRTPS_SOURCE}) - target_compile_definitions(BlackboxTests_FastRTPS PRIVATE - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>:FASTDDS_SHM_TRANSPORT_DISABLED> # Do not compile SHM Transport - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(BlackboxTests_FastRTPS PRIVATE - ${Asio_INCLUDE_DIR} - api/fastrtps_deprecated) - target_link_libraries(BlackboxTests_FastRTPS fastrtps fastcdr foonathan_memory GTest::gtest) - add_blackbox_gtest(BlackboxTests_FastRTPS SOURCES ${BLACKBOXTESTS_TEST_SOURCE} - ENVIRONMENTS "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs" - "TOPIC_RANDOM_NUMBER=${TOPIC_RANDOM_NUMBER}" - "W_UNICAST_PORT_RANDOM_NUMBER=${W_UNICAST_PORT_RANDOM_NUMBER}" - "R_UNICAST_PORT_RANDOM_NUMBER=${R_UNICAST_PORT_RANDOM_NUMBER}" - "MULTICAST_PORT_RANDOM_NUMBER=${MULTICAST_PORT_RANDOM_NUMBER}" - ) - endif(FASTRTPS_API_TESTS) + if (FASTDDS_STATISTICS) - if(FASTDDS_PIM_API_TESTS) - set(BLACKBOXTESTS_FASTDDS_PIM_SOURCE - ${DDS_BLACKBOXTESTS_SOURCE} - api/dds-pim/ReqRepHelloWorldRequester.cpp - api/dds-pim/ReqRepHelloWorldReplier.cpp + set(statistics_sources + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx ) - if (FASTDDS_STATISTICS) - - set(statistics_sources - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx - ) + list(APPEND BLACKBOXTESTS_FASTDDS_PIM_SOURCE ${statistics_sources}) - list(APPEND BLACKBOXTESTS_FASTDDS_PIM_SOURCE ${statistics_sources}) + endif() - endif() + add_executable(BlackboxTests_DDS_PIM ${BLACKBOXTESTS_FASTDDS_PIM_SOURCE}) + target_compile_definitions(BlackboxTests_DDS_PIM PRIVATE + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + $<$>:FASTDDS_SHM_TRANSPORT_DISABLED> # Do not compile SHM Transport + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(BlackboxTests_DDS_PIM PRIVATE + ${Asio_INCLUDE_DIR} + api/dds-pim) + target_link_libraries(BlackboxTests_DDS_PIM fastrtps fastcdr foonathan_memory GTest::gtest) + add_blackbox_gtest(BlackboxTests_DDS_PIM SOURCES ${DDS_BLACKBOXTESTS_SOURCE} + ENVIRONMENTS "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs" + "TOPIC_RANDOM_NUMBER=${TOPIC_RANDOM_NUMBER}" + "W_UNICAST_PORT_RANDOM_NUMBER=${W_UNICAST_PORT_RANDOM_NUMBER}" + "R_UNICAST_PORT_RANDOM_NUMBER=${R_UNICAST_PORT_RANDOM_NUMBER}" + "MULTICAST_PORT_RANDOM_NUMBER=${MULTICAST_PORT_RANDOM_NUMBER}" + ) + endif(FASTDDS_PIM_API_TESTS) - add_executable(BlackboxTests_DDS_PIM ${BLACKBOXTESTS_FASTDDS_PIM_SOURCE}) - target_compile_definitions(BlackboxTests_DDS_PIM PRIVATE - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>:FASTDDS_SHM_TRANSPORT_DISABLED> # Do not compile SHM Transport - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(BlackboxTests_DDS_PIM PRIVATE - ${Asio_INCLUDE_DIR} - api/dds-pim) - target_link_libraries(BlackboxTests_DDS_PIM fastrtps fastcdr foonathan_memory GTest::gtest) - add_blackbox_gtest(BlackboxTests_DDS_PIM SOURCES ${DDS_BLACKBOXTESTS_SOURCE} - ENVIRONMENTS "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs" - "TOPIC_RANDOM_NUMBER=${TOPIC_RANDOM_NUMBER}" - "W_UNICAST_PORT_RANDOM_NUMBER=${W_UNICAST_PORT_RANDOM_NUMBER}" - "R_UNICAST_PORT_RANDOM_NUMBER=${R_UNICAST_PORT_RANDOM_NUMBER}" - "MULTICAST_PORT_RANDOM_NUMBER=${MULTICAST_PORT_RANDOM_NUMBER}" - ) - endif(FASTDDS_PIM_API_TESTS) + # Add 'xfail' label to flaky tests + set(BLACKBOX_XFAIL_LIST XFAIL_RTPS) + if(FASTRTPS_API_TESTS) + set(BLACKBOX_XFAIL_LIST ${BLACKBOX_XFAIL_LIST} XFAIL_FASTRTPS) + endif() + if(FASTDDS_PIM_API_TESTS) + set(BLACKBOX_XFAIL_LIST ${BLACKBOX_XFAIL_LIST} XFAIL_DDS_PIM) + endif() - # Add 'xfail' label to flaky tests - set(BLACKBOX_XFAIL_LIST XFAIL_RTPS) - if(FASTRTPS_API_TESTS) - set(BLACKBOX_XFAIL_LIST ${BLACKBOX_XFAIL_LIST} XFAIL_FASTRTPS) - endif() - if(FASTDDS_PIM_API_TESTS) - set(BLACKBOX_XFAIL_LIST ${BLACKBOX_XFAIL_LIST} XFAIL_DDS_PIM) + foreach(BLACKBOX_XFAIL_TEST ${BLACKBOX_XFAIL_LIST}) + add_xfail_label(${CMAKE_CURRENT_SOURCE_DIR}/${BLACKBOX_XFAIL_TEST}.list) + if(SECURITY) + add_xfail_label(${CMAKE_CURRENT_SOURCE_DIR}/${BLACKBOX_XFAIL_TEST}_SECURITY.list) endif() - - foreach(BLACKBOX_XFAIL_TEST ${BLACKBOX_XFAIL_LIST}) - add_xfail_label(${CMAKE_CURRENT_SOURCE_DIR}/${BLACKBOX_XFAIL_TEST}.list) - if(SECURITY) - add_xfail_label(${CMAKE_CURRENT_SOURCE_DIR}/${BLACKBOX_XFAIL_TEST}_SECURITY.list) - endif() - endforeach() - endif() + endforeach() endif() diff --git a/test/realtime/CMakeLists.txt b/test/realtime/CMakeLists.txt index fec4fb33c9b..ce75f9a7c30 100644 --- a/test/realtime/CMakeLists.txt +++ b/test/realtime/CMakeLists.txt @@ -1,20 +1,18 @@ add_subdirectory(mutex_testing_tool) -if(GTest_FOUND) - set(USER_THREAD_NONBLOCKED_TEST UserThreadNonBlockedTest.cpp) +set(USER_THREAD_NONBLOCKED_TEST UserThreadNonBlockedTest.cpp) - add_executable(user_thread_nonblocked_test ${USER_THREAD_NONBLOCKED_TEST}) - target_compile_definitions(DDSSimpleCommunicationSubscriber PRIVATE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_link_libraries(user_thread_nonblocked_test mutex_testing_tool fastrtps fastcdr GTest::gtest) +add_executable(user_thread_nonblocked_test ${USER_THREAD_NONBLOCKED_TEST}) +target_compile_definitions(DDSSimpleCommunicationSubscriber PRIVATE + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) +target_link_libraries(user_thread_nonblocked_test mutex_testing_tool fastrtps fastcdr GTest::gtest) - STRING(REPLACE " " "\\ " MUTEX_PRELOAD_LIBRARY_FILE "$") - add_gtest(NAME UserThreadNonBlockedTest COMMAND user_thread_nonblocked_test SOURCES ${USER_THREAD_NONBLOCKED_TEST} - ENVIRONMENTS - "LD_LIBRARY_PATH=$" - "LD_PRELOAD=$" - LABELS "NoMemoryCheck" - ) -endif() +STRING(REPLACE " " "\\ " MUTEX_PRELOAD_LIBRARY_FILE "$") +add_gtest(NAME UserThreadNonBlockedTest COMMAND user_thread_nonblocked_test SOURCES ${USER_THREAD_NONBLOCKED_TEST} + ENVIRONMENTS + "LD_LIBRARY_PATH=$" + "LD_PRELOAD=$" + LABELS "NoMemoryCheck" + ) diff --git a/test/realtime/mutex_testing_tool/CMakeLists.txt b/test/realtime/mutex_testing_tool/CMakeLists.txt index fc00cb1db0c..107cf7a51eb 100644 --- a/test/realtime/mutex_testing_tool/CMakeLists.txt +++ b/test/realtime/mutex_testing_tool/CMakeLists.txt @@ -12,19 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -if(GTest_FOUND) - add_library(mutex_testing_tool SHARED TMutex.cpp) +add_library(mutex_testing_tool SHARED TMutex.cpp) - add_library(mutex_testing_tool_preload SHARED Mutex.cpp) - target_link_libraries(mutex_testing_tool_preload PRIVATE mutex_testing_tool ${CMAKE_DL_LIBS}) +add_library(mutex_testing_tool_preload SHARED Mutex.cpp) +target_link_libraries(mutex_testing_tool_preload PRIVATE mutex_testing_tool ${CMAKE_DL_LIBS}) - add_executable(TMutexTests TMutexTests.cpp) - target_link_libraries(TMutexTests mutex_testing_tool GTest::gtest) - STRING(REPLACE " " "\\ " MUTEX_PRELOAD_LIBRARY_FILE "$") - add_gtest(TMutexTests SOURCES TMutexTests.cpp - ENVIRONMENTS - "LD_LIBRARY_PATH=$" - "LD_PRELOAD=$" - LABELS "NoMemoryCheck" - ) -endif(GTest_FOUND) +add_executable(TMutexTests TMutexTests.cpp) +target_link_libraries(TMutexTests mutex_testing_tool GTest::gtest) +STRING(REPLACE " " "\\ " MUTEX_PRELOAD_LIBRARY_FILE "$") +add_gtest(TMutexTests SOURCES TMutexTests.cpp + ENVIRONMENTS + "LD_LIBRARY_PATH=$" + "LD_PRELOAD=$" + LABELS "NoMemoryCheck" + ) diff --git a/test/unittest/dds/collections/CMakeLists.txt b/test/unittest/dds/collections/CMakeLists.txt index 6c3d7c84e4b..5c32bdec92b 100644 --- a/test/unittest/dds/collections/CMakeLists.txt +++ b/test/unittest/dds/collections/CMakeLists.txt @@ -13,26 +13,24 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - endif() + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) + endif() - set(LOANABLE_SEQUENCE_TESTS_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - LoanableSequenceTests.cpp) + set(LOANABLE_SEQUENCE_TESTS_SOURCE + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + LoanableSequenceTests.cpp) - add_executable(LoanableSequenceTests ${LOANABLE_SEQUENCE_TESTS_SOURCE}) - target_compile_definitions(LoanableSequenceTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(LoanableSequenceTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(LoanableSequenceTests GTest::gtest) - add_gtest(LoanableSequenceTests SOURCES ${LOANABLE_SEQUENCE_TESTS_SOURCE}) - endif() + add_executable(LoanableSequenceTests ${LOANABLE_SEQUENCE_TESTS_SOURCE}) + target_compile_definitions(LoanableSequenceTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(LoanableSequenceTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(LoanableSequenceTests GTest::gtest) + add_gtest(LoanableSequenceTests SOURCES ${LOANABLE_SEQUENCE_TESTS_SOURCE}) endif() diff --git a/test/unittest/dds/core/condition/CMakeLists.txt b/test/unittest/dds/core/condition/CMakeLists.txt index 3e8443754f9..021db5200dc 100644 --- a/test/unittest/dds/core/condition/CMakeLists.txt +++ b/test/unittest/dds/core/condition/CMakeLists.txt @@ -13,30 +13,28 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - endif() + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) + endif() - set(CONDITION_TESTS_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/StatusCondition.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/WaitSet.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ConditionTests.cpp) + set(CONDITION_TESTS_SOURCE + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/StatusCondition.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/WaitSet.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ConditionTests.cpp) - add_executable(ConditionTests ${CONDITION_TESTS_SOURCE}) - target_compile_definitions(ConditionTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(ConditionTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(ConditionTests GTest::gtest fastcdr) - add_gtest(ConditionTests SOURCES ${CONDITION_TESTS_SOURCE}) - endif() + add_executable(ConditionTests ${CONDITION_TESTS_SOURCE}) + target_compile_definitions(ConditionTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(ConditionTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(ConditionTests GTest::gtest fastcdr) + add_gtest(ConditionTests SOURCES ${CONDITION_TESTS_SOURCE}) endif() diff --git a/test/unittest/dds/core/entity/CMakeLists.txt b/test/unittest/dds/core/entity/CMakeLists.txt index d0ae6eec3f3..a02d205cd7b 100644 --- a/test/unittest/dds/core/entity/CMakeLists.txt +++ b/test/unittest/dds/core/entity/CMakeLists.txt @@ -13,29 +13,27 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - endif() + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) + endif() - set(ENTITY_TESTS_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/StatusCondition.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - EntityTests.cpp) + set(ENTITY_TESTS_SOURCE + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/condition/StatusCondition.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + EntityTests.cpp) - add_executable(EntityTests ${ENTITY_TESTS_SOURCE}) - target_compile_definitions(EntityTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(EntityTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(EntityTests GTest::gtest fastcdr) - add_gtest(EntityTests SOURCES ${ENTITY_TESTS_SOURCE}) - endif() + add_executable(EntityTests ${ENTITY_TESTS_SOURCE}) + target_compile_definitions(EntityTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(EntityTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(EntityTests GTest::gtest fastcdr) + add_gtest(EntityTests SOURCES ${ENTITY_TESTS_SOURCE}) endif() diff --git a/test/unittest/dds/participant/CMakeLists.txt b/test/unittest/dds/participant/CMakeLists.txt index a09b9737d1d..f0d4e2724e6 100644 --- a/test/unittest/dds/participant/CMakeLists.txt +++ b/test/unittest/dds/participant/CMakeLists.txt @@ -13,32 +13,28 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - find_package(Threads REQUIRED) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../profiles/test_xml_profiles.xml + ${CMAKE_CURRENT_BINARY_DIR}/test_xml_profiles.xml + COPYONLY) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../profiles/test_xml_profiles.xml - ${CMAKE_CURRENT_BINARY_DIR}/test_xml_profiles.xml - COPYONLY) + set(PARTICIPANTTESTS_SOURCE ParticipantTests.cpp + ) - set(PARTICIPANTTESTS_SOURCE ParticipantTests.cpp - ) - - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - endif() - - add_executable(ParticipantTests ${PARTICIPANTTESTS_SOURCE}) - target_compile_definitions(ParticipantTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(ParticipantTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) - target_link_libraries(ParticipantTests fastrtps fastcdr foonathan_memory - GTest::gmock - ${CMAKE_DL_LIBS}) - add_gtest(ParticipantTests SOURCES ${PARTICIPANTTESTS_SOURCE}) + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) endif() + + add_executable(ParticipantTests ${PARTICIPANTTESTS_SOURCE}) + target_compile_definitions(ParticipantTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(ParticipantTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) + target_link_libraries(ParticipantTests fastrtps fastcdr foonathan_memory + GTest::gmock + ${CMAKE_DL_LIBS}) + add_gtest(ParticipantTests SOURCES ${PARTICIPANTTESTS_SOURCE}) endif() diff --git a/test/unittest/dds/publisher/CMakeLists.txt b/test/unittest/dds/publisher/CMakeLists.txt index 5d7352c87b2..786743a8f82 100644 --- a/test/unittest/dds/publisher/CMakeLists.txt +++ b/test/unittest/dds/publisher/CMakeLists.txt @@ -13,54 +13,50 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND ) - find_package(Threads REQUIRED) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../profiles/test_xml_profiles.xml + ${CMAKE_CURRENT_BINARY_DIR}/test_xml_profiles.xml + COPYONLY) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../profiles/test_xml_profiles.xml - ${CMAKE_CURRENT_BINARY_DIR}/test_xml_profiles.xml - COPYONLY) + set(PUBLISHERTESTS_SOURCE PublisherTests.cpp) + set(DATAWRITERTESTS_SOURCE DataWriterTests.cpp) + set(PUBLISHERTESTS_SOURCE PublisherTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dds/pub/DataWriter.cpp + ) - set(PUBLISHERTESTS_SOURCE PublisherTests.cpp) - set(DATAWRITERTESTS_SOURCE DataWriterTests.cpp) - set(PUBLISHERTESTS_SOURCE PublisherTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dds/pub/DataWriter.cpp + if(WIN32) + add_definitions( + -D_WIN32_WINNT=0x0601 + -D_CRT_SECURE_NO_WARNINGS ) + endif() - if(WIN32) - add_definitions( - -D_WIN32_WINNT=0x0601 - -D_CRT_SECURE_NO_WARNINGS - ) - endif() - - add_executable(PublisherTests ${PUBLISHERTESTS_SOURCE}) - target_compile_definitions(PublisherTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(PublisherTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) - target_link_libraries(PublisherTests fastrtps fastcdr foonathan_memory - GTest::gmock - ${CMAKE_DL_LIBS}) - add_gtest(PublisherTests SOURCES ${PUBLISHERTESTS_SOURCE}) + add_executable(PublisherTests ${PUBLISHERTESTS_SOURCE}) + target_compile_definitions(PublisherTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(PublisherTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) + target_link_libraries(PublisherTests fastrtps fastcdr foonathan_memory + GTest::gmock + ${CMAKE_DL_LIBS}) + add_gtest(PublisherTests SOURCES ${PUBLISHERTESTS_SOURCE}) - add_executable(DataWriterTests ${DATAWRITERTESTS_SOURCE}) - target_compile_definitions(DataWriterTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(DataWriterTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) - target_link_libraries(DataWriterTests fastrtps fastcdr foonathan_memory - GTest::gmock - ${CMAKE_DL_LIBS}) - add_gtest(DataWriterTests - SOURCES ${DATAWRITERTESTS_SOURCE} - ENVIRONMENTS "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs") - endif() + add_executable(DataWriterTests ${DATAWRITERTESTS_SOURCE}) + target_compile_definitions(DataWriterTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(DataWriterTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) + target_link_libraries(DataWriterTests fastrtps fastcdr foonathan_memory + GTest::gmock + ${CMAKE_DL_LIBS}) + add_gtest(DataWriterTests + SOURCES ${DATAWRITERTESTS_SOURCE} + ENVIRONMENTS "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs") endif() diff --git a/test/unittest/dds/status/CMakeLists.txt b/test/unittest/dds/status/CMakeLists.txt index 1a02b7d8a29..7aa42c3a6d3 100644 --- a/test/unittest/dds/status/CMakeLists.txt +++ b/test/unittest/dds/status/CMakeLists.txt @@ -13,162 +13,158 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - find_package(Threads REQUIRED) + set(LISTENERTESTS_SOURCE ListenerTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/QosPolicyUtils.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/DomainParticipant.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/DomainParticipantFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/DomainParticipantImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/qos/DomainParticipantQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/qos/DomainParticipantFactoryQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/Publisher.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/PublisherImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/DataWriter.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/DataWriterImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/PublisherQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/DataWriterQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/Subscriber.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/SubscriberImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/DataReader.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/DataReaderImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/SubscriberQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/DataReaderQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/Topic.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/qos/TopicQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TypeSupport.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPool.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPoolRegistry.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/LocatorSelectorSender.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastrtps_deprecated/publisher/PublisherHistory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastrtps_deprecated/subscriber/SubscriberHistory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipant.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/publisher/qos/DataWriterQos.cpp + ) - set(LISTENERTESTS_SOURCE ListenerTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/QosPolicyUtils.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/DomainParticipant.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/DomainParticipantFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/DomainParticipantImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/qos/DomainParticipantQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/qos/DomainParticipantFactoryQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/Publisher.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/PublisherImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/DataWriter.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/DataWriterImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/PublisherQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/DataWriterQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/Subscriber.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/SubscriberImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/DataReader.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/DataReaderImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/SubscriberQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/DataReaderQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/Topic.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/qos/TopicQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TypeSupport.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPool.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPoolRegistry.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/LocatorSelectorSender.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastrtps_deprecated/publisher/PublisherHistory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastrtps_deprecated/subscriber/SubscriberHistory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipant.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/publisher/qos/DataWriterQos.cpp - ) + if (FASTDDS_STATISTICS) - if (FASTDDS_STATISTICS) + set(statistics_sources + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx + ) - set(statistics_sources - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx - ) + list(APPEND LISTENERTESTS_SOURCE ${statistics_sources}) - list(APPEND LISTENERTESTS_SOURCE ${statistics_sources}) + endif() - endif() + # External sources + if(TINYXML2_SOURCE_DIR) + list(APPEND LISTENERTESTS_SOURCE + ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp + ) + endif() - # External sources - if(TINYXML2_SOURCE_DIR) - list(APPEND LISTENERTESTS_SOURCE - ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp - ) - endif() + include_directories(${TINYXML2_INCLUDE_DIR}) - include_directories(${TINYXML2_INCLUDE_DIR}) + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) + endif() - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - endif() + add_executable(ListenerTests ${LISTENERTESTS_SOURCE}) + target_compile_definitions(ListenerTests PRIVATE FASTRTPS_NO_LIB + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + $<$,$>,$>>:ASIO_DISABLE_STD_STRING_VIEW> + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(ListenerTests PRIVATE + ${Asio_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/test/mock/rtps/DataSharingPayloadPool + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSReader + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSWriter + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomain + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSParticipant + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSParticipantImpl + ${PROJECT_SOURCE_DIR}/test/mock/rtps/Endpoint + ${PROJECT_SOURCE_DIR}/test/mock/rtps/PDP + ${PROJECT_SOURCE_DIR}/test/mock/rtps/PDPSimple + ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatefulWriter + ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatelessWriter + ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatefulReader + ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatelessReader + ${PROJECT_SOURCE_DIR}/test/mock/rtps/WriterHistory + ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderHistory + ${PROJECT_SOURCE_DIR}/test/mock/rtps/ResourceEvent + ${PROJECT_SOURCE_DIR}/test/mock/rtps/TimedEvent + ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPTransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPv4TransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPv6TransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPTransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv4TransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv6TransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/SharedMemTransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/TypeLookupManager + ${PROJECT_SOURCE_DIR}/test/mock/rtps/WLP + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) - add_executable(ListenerTests ${LISTENERTESTS_SOURCE}) - target_compile_definitions(ListenerTests PRIVATE FASTRTPS_NO_LIB - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$,$>,$>>:ASIO_DISABLE_STD_STRING_VIEW> - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(ListenerTests PRIVATE - ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/test/mock/rtps/DataSharingPayloadPool - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSReader - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSWriter - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomain - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSParticipant - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSParticipantImpl - ${PROJECT_SOURCE_DIR}/test/mock/rtps/Endpoint - ${PROJECT_SOURCE_DIR}/test/mock/rtps/PDP - ${PROJECT_SOURCE_DIR}/test/mock/rtps/PDPSimple - ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatefulWriter - ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatelessWriter - ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatefulReader - ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatelessReader - ${PROJECT_SOURCE_DIR}/test/mock/rtps/WriterHistory - ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderHistory - ${PROJECT_SOURCE_DIR}/test/mock/rtps/ResourceEvent - ${PROJECT_SOURCE_DIR}/test/mock/rtps/TimedEvent - ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPTransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPv4TransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPv6TransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPTransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv4TransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv6TransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/SharedMemTransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/TypeLookupManager - ${PROJECT_SOURCE_DIR}/test/mock/rtps/WLP - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) + target_link_libraries(ListenerTests fastcdr foonathan_memory + ${TINYXML2_LIBRARY} + GTest::gmock + ${CMAKE_DL_LIBS}) + if(MSVC OR MSVC_IDE) + target_link_libraries(ListenerTests iphlpapi Shlwapi ws2_32) + endif() - target_link_libraries(ListenerTests fastcdr foonathan_memory - ${TINYXML2_LIBRARY} - GTest::gmock - ${CMAKE_DL_LIBS}) - if(MSVC OR MSVC_IDE) - target_link_libraries(ListenerTests iphlpapi Shlwapi ws2_32) - endif() - - add_gtest(ListenerTests SOURCES ${LISTENERTESTS_SOURCE}) + add_gtest(ListenerTests SOURCES ${LISTENERTESTS_SOURCE}) - endif() endif() diff --git a/test/unittest/dds/subscriber/CMakeLists.txt b/test/unittest/dds/subscriber/CMakeLists.txt index b24e4e81b6d..9094f488d20 100644 --- a/test/unittest/dds/subscriber/CMakeLists.txt +++ b/test/unittest/dds/subscriber/CMakeLists.txt @@ -13,46 +13,42 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - find_package(Threads REQUIRED) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../profiles/test_xml_profiles.xml + ${CMAKE_CURRENT_BINARY_DIR}/test_xml_profiles.xml + COPYONLY) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../profiles/test_xml_profiles.xml - ${CMAKE_CURRENT_BINARY_DIR}/test_xml_profiles.xml - COPYONLY) + set(SUBSCRIBERTESTS_SOURCE SubscriberTests.cpp) + set(DATAREADERTESTS_SOURCE DataReaderTests.cpp) - set(SUBSCRIBERTESTS_SOURCE SubscriberTests.cpp) - set(DATAREADERTESTS_SOURCE DataReaderTests.cpp) - - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - endif() + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) + endif() - add_executable(SubscriberTests ${SUBSCRIBERTESTS_SOURCE}) - target_compile_definitions(SubscriberTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(SubscriberTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) - target_link_libraries(SubscriberTests fastrtps fastcdr foonathan_memory - GTest::gmock - ${CMAKE_DL_LIBS}) - add_gtest(SubscriberTests SOURCES ${SUBSCRIBERTESTS_SOURCE}) + add_executable(SubscriberTests ${SUBSCRIBERTESTS_SOURCE}) + target_compile_definitions(SubscriberTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(SubscriberTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) + target_link_libraries(SubscriberTests fastrtps fastcdr foonathan_memory + GTest::gmock + ${CMAKE_DL_LIBS}) + add_gtest(SubscriberTests SOURCES ${SUBSCRIBERTESTS_SOURCE}) - add_executable(DataReaderTests ${DATAREADERTESTS_SOURCE}) - target_compile_definitions(DataReaderTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(DataReaderTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) - target_link_libraries(DataReaderTests fastrtps fastcdr foonathan_memory - GTest::gmock - ${CMAKE_DL_LIBS}) - add_gtest(DataReaderTests SOURCES ${DATAREADERTESTS_SOURCE}) - endif() + add_executable(DataReaderTests ${DATAREADERTESTS_SOURCE}) + target_compile_definitions(DataReaderTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(DataReaderTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) + target_link_libraries(DataReaderTests fastrtps fastcdr foonathan_memory + GTest::gmock + ${CMAKE_DL_LIBS}) + add_gtest(DataReaderTests SOURCES ${DATAREADERTESTS_SOURCE}) endif() diff --git a/test/unittest/dds/topic/CMakeLists.txt b/test/unittest/dds/topic/CMakeLists.txt index 11ae861696d..7db27bc4183 100644 --- a/test/unittest/dds/topic/CMakeLists.txt +++ b/test/unittest/dds/topic/CMakeLists.txt @@ -13,32 +13,27 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - find_package(Threads REQUIRED) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../profiles/test_xml_profiles.xml + ${CMAKE_CURRENT_BINARY_DIR}/test_xml_profiles.xml + COPYONLY) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../profiles/test_xml_profiles.xml - ${CMAKE_CURRENT_BINARY_DIR}/test_xml_profiles.xml - COPYONLY) - - set(TOPICTESTS_SOURCE TopicTests.cpp) - - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - endif() - - add_executable(TopicTests ${TOPICTESTS_SOURCE}) - target_compile_definitions(TopicTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(TopicTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) - target_link_libraries(TopicTests fastrtps fastcdr foonathan_memory - GTest::gmock - ${CMAKE_DL_LIBS}) - add_gtest(TopicTests SOURCES ${TOPICTESTS_SOURCE}) + set(TOPICTESTS_SOURCE TopicTests.cpp) + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) endif() + + add_executable(TopicTests ${TOPICTESTS_SOURCE}) + target_compile_definitions(TopicTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(TopicTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) + target_link_libraries(TopicTests fastrtps fastcdr foonathan_memory + GTest::gmock + ${CMAKE_DL_LIBS}) + add_gtest(TopicTests SOURCES ${TOPICTESTS_SOURCE}) endif() diff --git a/test/unittest/dynamic_types/CMakeLists.txt b/test/unittest/dynamic_types/CMakeLists.txt index 4217597f7b7..35531774038 100644 --- a/test/unittest/dynamic_types/CMakeLists.txt +++ b/test/unittest/dynamic_types/CMakeLists.txt @@ -13,158 +13,156 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - if(WIN32) - add_definitions( - -D_WIN32_WINNT=0x0601 - -D_CRT_SECURE_NO_WARNINGS - ) - endif() + if(WIN32) + add_definitions( + -D_WIN32_WINNT=0x0601 + -D_CRT_SECURE_NO_WARNINGS + ) + endif() - set(DYNAMIC_TYPES_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + set(DYNAMIC_TYPES_SOURCE + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ) - # External sources - if(TINYXML2_SOURCE_DIR) - list(APPEND DYNAMIC_TYPES_SOURCE - ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp - ) - endif() + # External sources + if(TINYXML2_SOURCE_DIR) + list(APPEND DYNAMIC_TYPES_SOURCE + ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp + ) + endif() - set(DYNAMIC_TYPES_TEST_SOURCE - DynamicTypesTests.cpp - idl/Basic.cxx - idl/BasicPubSubTypes.cxx - idl/BasicTypeObject.cxx - ${DYNAMIC_TYPES_SOURCE} + set(DYNAMIC_TYPES_TEST_SOURCE + DynamicTypesTests.cpp + idl/Basic.cxx + idl/BasicPubSubTypes.cxx + idl/BasicTypeObject.cxx + ${DYNAMIC_TYPES_SOURCE} - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp ) - set(DYNAMIC_COMPLEX_TYPES_TEST_SOURCE - DynamicComplexTypesTests.cpp - idl/Test.cxx - idl/TestPubSubTypes.cxx - idl/TestTypeObject.cxx - ${DYNAMIC_TYPES_SOURCE} + set(DYNAMIC_COMPLEX_TYPES_TEST_SOURCE + DynamicComplexTypesTests.cpp + idl/Test.cxx + idl/TestPubSubTypes.cxx + idl/TestTypeObject.cxx + ${DYNAMIC_TYPES_SOURCE} ) - set(DYNAMIC_TYPES_4_2_TEST_SOURCE - DynamicTypes_4_2_Tests.cpp - idl/new_features_4_2.cxx - idl/new_features_4_2PubSubTypes.cxx - idl/new_features_4_2TypeObject.cxx - ${DYNAMIC_TYPES_SOURCE} + set(DYNAMIC_TYPES_4_2_TEST_SOURCE + DynamicTypes_4_2_Tests.cpp + idl/new_features_4_2.cxx + idl/new_features_4_2PubSubTypes.cxx + idl/new_features_4_2TypeObject.cxx + ${DYNAMIC_TYPES_SOURCE} ) - include_directories(mock/) + include_directories(mock/) - add_executable(DynamicTypesTests ${DYNAMIC_TYPES_TEST_SOURCE}) - target_compile_definitions(DynamicTypesTests PRIVATE FASTRTPS_NO_LIB - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(DynamicTypesTests PRIVATE - ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPTransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv4TransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv6TransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPTransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPv4TransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPv6TransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/SharedMemTransportDescriptor - ${TINYXML2_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ) - target_link_libraries(DynamicTypesTests GTest::gtest - $<$:iphlpapi$Shlwapi> - $<$:ws2_32> - ${TINYXML2_LIBRARY} - fastcdr + add_executable(DynamicTypesTests ${DYNAMIC_TYPES_TEST_SOURCE}) + target_compile_definitions(DynamicTypesTests PRIVATE FASTRTPS_NO_LIB + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(DynamicTypesTests PRIVATE + ${Asio_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPTransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv4TransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv6TransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPTransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPv4TransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPv6TransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/SharedMemTransportDescriptor + ${TINYXML2_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ) - add_gtest(DynamicTypesTests SOURCES ${DYNAMIC_TYPES_TEST_SOURCE}) + target_link_libraries(DynamicTypesTests GTest::gtest + $<$:iphlpapi$Shlwapi> + $<$:ws2_32> + ${TINYXML2_LIBRARY} + fastcdr + ) + add_gtest(DynamicTypesTests SOURCES ${DYNAMIC_TYPES_TEST_SOURCE}) - add_executable(DynamicComplexTypesTests ${DYNAMIC_COMPLEX_TYPES_TEST_SOURCE}) - target_compile_definitions(DynamicComplexTypesTests PRIVATE FASTRTPS_NO_LIB - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(DynamicComplexTypesTests PRIVATE - ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(DynamicComplexTypesTests GTest::gtest - $<$:iphlpapi$Shlwapi> - $<$:ws2_32> - ${TINYXML2_LIBRARY} - fastcdr + add_executable(DynamicComplexTypesTests ${DYNAMIC_COMPLEX_TYPES_TEST_SOURCE}) + target_compile_definitions(DynamicComplexTypesTests PRIVATE FASTRTPS_NO_LIB + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(DynamicComplexTypesTests PRIVATE + ${Asio_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(DynamicComplexTypesTests GTest::gtest + $<$:iphlpapi$Shlwapi> + $<$:ws2_32> + ${TINYXML2_LIBRARY} + fastcdr ) - add_gtest(DynamicComplexTypesTests SOURCES ${DYNAMIC_COMPLEX_TYPES_TEST_SOURCE}) + add_gtest(DynamicComplexTypesTests SOURCES ${DYNAMIC_COMPLEX_TYPES_TEST_SOURCE}) - add_executable(DynamicTypes_4_2_Tests ${DYNAMIC_TYPES_4_2_TEST_SOURCE}) - target_compile_definitions(DynamicTypes_4_2_Tests PRIVATE FASTRTPS_NO_LIB - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(DynamicTypes_4_2_Tests PRIVATE - ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(DynamicTypes_4_2_Tests GTest::gtest - $<$:iphlpapi$Shlwapi> - $<$:ws2_32> - ${TINYXML2_LIBRARY} - fastcdr + add_executable(DynamicTypes_4_2_Tests ${DYNAMIC_TYPES_4_2_TEST_SOURCE}) + target_compile_definitions(DynamicTypes_4_2_Tests PRIVATE FASTRTPS_NO_LIB + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(DynamicTypes_4_2_Tests PRIVATE + ${Asio_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(DynamicTypes_4_2_Tests GTest::gtest + $<$:iphlpapi$Shlwapi> + $<$:ws2_32> + ${TINYXML2_LIBRARY} + fastcdr ) - add_gtest(DynamicTypes_4_2_Tests SOURCES ${DYNAMIC_TYPES_4_2_TEST_SOURCE}) + add_gtest(DynamicTypes_4_2_Tests SOURCES ${DYNAMIC_TYPES_4_2_TEST_SOURCE}) - endif() endif() configure_file("types.xml" "types.xml" COPYONLY) diff --git a/test/unittest/logging/CMakeLists.txt b/test/unittest/logging/CMakeLists.txt index 9566f0fdc15..d17a7ced6c7 100644 --- a/test/unittest/logging/CMakeLists.txt +++ b/test/unittest/logging/CMakeLists.txt @@ -15,67 +15,64 @@ add_subdirectory(log_macros) if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - endif() - - set(LOG_COMMON_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ) - - set(LOGTESTS_TEST_SOURCE LogTests.cpp) + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) + endif() - set(LOGTESTS_SOURCE - ${LOG_COMMON_SOURCE} - ${LOGTESTS_TEST_SOURCE}) + set(LOG_COMMON_SOURCE + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ) - include_directories(mock/) + set(LOGTESTS_TEST_SOURCE LogTests.cpp) - add_executable(LogTests ${LOGTESTS_SOURCE}) - target_compile_definitions(LogTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(LogTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(LogTests GTest::gtest ${MOCKS} - $<$:iphlpapi$Shlwapi> - ) - add_gtest(LogTests SOURCES ${LOGTESTS_TEST_SOURCE}) + set(LOGTESTS_SOURCE + ${LOG_COMMON_SOURCE} + ${LOGTESTS_TEST_SOURCE}) - set(LOGFILETESTS_TEST_SOURCE LogFileTests.cpp) + include_directories(mock/) - set(LOGFILETESTS_SOURCE - ${LOG_COMMON_SOURCE} - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp - ${LOGFILETESTS_TEST_SOURCE}) + add_executable(LogTests ${LOGTESTS_SOURCE}) + target_compile_definitions(LogTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(LogTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(LogTests GTest::gtest ${MOCKS} + $<$:iphlpapi$Shlwapi> + ) + add_gtest(LogTests SOURCES ${LOGTESTS_TEST_SOURCE}) - # External sources - if(TINYXML2_SOURCE_DIR) - list(APPEND LOGFILETESTS_SOURCE - ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp - ) - endif() + set(LOGFILETESTS_TEST_SOURCE LogFileTests.cpp) - include_directories(${TINYXML2_INCLUDE_DIR}) + set(LOGFILETESTS_SOURCE + ${LOG_COMMON_SOURCE} + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp + ${LOGFILETESTS_TEST_SOURCE}) - add_executable(LogFileTests ${LOGFILETESTS_SOURCE}) - target_compile_definitions(LogFileTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(LogFileTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(LogFileTests GTest::gtest ${MOCKS} - $<$:iphlpapi$Shlwapi> - ${TINYXML2_LIBRARY} - fastcdr + # External sources + if(TINYXML2_SOURCE_DIR) + list(APPEND LOGFILETESTS_SOURCE + ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp ) - add_gtest(LogFileTests SOURCES ${LOGFILETESTS_TEST_SOURCE}) - endif() + + include_directories(${TINYXML2_INCLUDE_DIR}) + + add_executable(LogFileTests ${LOGFILETESTS_SOURCE}) + target_compile_definitions(LogFileTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(LogFileTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(LogFileTests GTest::gtest ${MOCKS} + $<$:iphlpapi$Shlwapi> + ${TINYXML2_LIBRARY} + fastcdr + ) + add_gtest(LogFileTests SOURCES ${LOGFILETESTS_TEST_SOURCE}) endif() diff --git a/test/unittest/logging/log_macros/CMakeLists.txt b/test/unittest/logging/log_macros/CMakeLists.txt index 6e961b50d32..fd8e302af35 100644 --- a/test/unittest/logging/log_macros/CMakeLists.txt +++ b/test/unittest/logging/log_macros/CMakeLists.txt @@ -13,138 +13,135 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - endif() - - set(LOG_COMMON_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ) - - # MACROS LOG TEST ALL - set(LOGMACROS_ALL_TEST_SOURCE LogMacrosAllActiveTests.cpp) - - set(LOGMACROS_SOURCE - ${LOG_COMMON_SOURCE} - ${LOGMACROS_ALL_TEST_SOURCE}) - - add_executable(LogMacrosAllActiveTests ${LOGMACROS_SOURCE}) - target_compile_definitions(LogMacrosAllActiveTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(LogMacrosAllActiveTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(LogMacrosAllActiveTests GTest::gtest ${MOCKS} - $<$:iphlpapi$Shlwapi> - ) - add_gtest(LogMacrosAllActiveTests SOURCES ${LOGMACROS_ALL_TEST_SOURCE}) - - - # MACROS LOG TEST NO INFO - set(LOGMACROS_NOINFO_TEST_SOURCE LogMacrosNoInfoTests.cpp) - - set(LOGMACROS_SOURCE - ${LOG_COMMON_SOURCE} - ${LOGMACROS_NOINFO_TEST_SOURCE}) - - add_executable(LogMacrosNoInfoTests ${LOGMACROS_SOURCE}) - target_compile_definitions(LogMacrosNoInfoTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(LogMacrosNoInfoTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(LogMacrosNoInfoTests GTest::gtest ${MOCKS} - $<$:iphlpapi$Shlwapi> - ) - add_gtest(LogMacrosNoInfoTests SOURCES ${LOGMACROS_NOINFO_TEST_SOURCE}) - - - # MACROS LOG TEST NO WARNING - set(LOGMACROS_NOWARNING_TEST_SOURCE LogMacrosNoWarningTests.cpp) - - set(LOGMACROS_SOURCE - ${LOG_COMMON_SOURCE} - ${LOGMACROS_NOWARNING_TEST_SOURCE}) - - add_executable(LogMacrosNoWarningTests ${LOGMACROS_SOURCE}) - target_compile_definitions(LogMacrosNoWarningTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(LogMacrosNoWarningTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(LogMacrosNoWarningTests GTest::gtest ${MOCKS} - $<$:iphlpapi$Shlwapi> - ) - add_gtest(LogMacrosNoWarningTests SOURCES ${LOGMACROS_NOWARNING_TEST_SOURCE}) - - - # MACROS LOG TEST NO ERROR - set(LOGMACROS_NOERROR_TEST_SOURCE LogMacrosNoErrorTests.cpp) - - set(LOGMACROS_SOURCE - ${LOG_COMMON_SOURCE} - ${LOGMACROS_NOERROR_TEST_SOURCE}) - - add_executable(LogMacrosNoErrorTests ${LOGMACROS_SOURCE}) - target_compile_definitions(LogMacrosNoErrorTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(LogMacrosNoErrorTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(LogMacrosNoErrorTests GTest::gtest ${MOCKS} - $<$:iphlpapi$Shlwapi> - ) - add_gtest(LogMacrosNoErrorTests SOURCES ${LOGMACROS_NOERROR_TEST_SOURCE}) - - - # MACROS LOG TEST NO DEFAULT - set(LOGMACROS_DEFAULT_TEST_SOURCE LogMacrosDefaultTests.cpp) - - set(LOGMACROS_SOURCE - ${LOG_COMMON_SOURCE} - ${LOGMACROS_DEFAULT_TEST_SOURCE}) - - add_executable(LogMacrosDefaultTests ${LOGMACROS_SOURCE}) - target_compile_definitions(LogMacrosDefaultTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(LogMacrosDefaultTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(LogMacrosDefaultTests GTest::gtest ${MOCKS} - $<$:iphlpapi$Shlwapi> - ) - add_gtest(LogMacrosDefaultTests SOURCES ${LOGMACROS_DEFAULT_TEST_SOURCE}) - - - # MACROS LOG TEST INTERNALDEBUG - # In case this test fails, it fails de compilation - - set(LOGMACROS_INTERNALDEBUG_TEST_SOURCE LogMacrosInternalDebugOffTests.cpp) - - set(LOGMACROS_SOURCE - ${LOG_COMMON_SOURCE} - ${LOGMACROS_INTERNALDEBUG_TEST_SOURCE}) - - add_executable(LogMacrosInternalDebugOffTests ${LOGMACROS_SOURCE}) - target_compile_definitions(LogMacrosInternalDebugOffTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(LogMacrosInternalDebugOffTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(LogMacrosInternalDebugOffTests GTest::gtest ${MOCKS} - $<$:iphlpapi$Shlwapi> - ) - add_gtest(LogMacrosInternalDebugOffTests SOURCES ${LOGMACROS_INTERNALDEBUG_TEST_SOURCE}) - + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) endif() + + set(LOG_COMMON_SOURCE + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ) + + # MACROS LOG TEST ALL + set(LOGMACROS_ALL_TEST_SOURCE LogMacrosAllActiveTests.cpp) + + set(LOGMACROS_SOURCE + ${LOG_COMMON_SOURCE} + ${LOGMACROS_ALL_TEST_SOURCE}) + + add_executable(LogMacrosAllActiveTests ${LOGMACROS_SOURCE}) + target_compile_definitions(LogMacrosAllActiveTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(LogMacrosAllActiveTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(LogMacrosAllActiveTests GTest::gtest ${MOCKS} + $<$:iphlpapi$Shlwapi> + ) + add_gtest(LogMacrosAllActiveTests SOURCES ${LOGMACROS_ALL_TEST_SOURCE}) + + + # MACROS LOG TEST NO INFO + set(LOGMACROS_NOINFO_TEST_SOURCE LogMacrosNoInfoTests.cpp) + + set(LOGMACROS_SOURCE + ${LOG_COMMON_SOURCE} + ${LOGMACROS_NOINFO_TEST_SOURCE}) + + add_executable(LogMacrosNoInfoTests ${LOGMACROS_SOURCE}) + target_compile_definitions(LogMacrosNoInfoTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(LogMacrosNoInfoTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(LogMacrosNoInfoTests GTest::gtest ${MOCKS} + $<$:iphlpapi$Shlwapi> + ) + add_gtest(LogMacrosNoInfoTests SOURCES ${LOGMACROS_NOINFO_TEST_SOURCE}) + + + # MACROS LOG TEST NO WARNING + set(LOGMACROS_NOWARNING_TEST_SOURCE LogMacrosNoWarningTests.cpp) + + set(LOGMACROS_SOURCE + ${LOG_COMMON_SOURCE} + ${LOGMACROS_NOWARNING_TEST_SOURCE}) + + add_executable(LogMacrosNoWarningTests ${LOGMACROS_SOURCE}) + target_compile_definitions(LogMacrosNoWarningTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(LogMacrosNoWarningTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(LogMacrosNoWarningTests GTest::gtest ${MOCKS} + $<$:iphlpapi$Shlwapi> + ) + add_gtest(LogMacrosNoWarningTests SOURCES ${LOGMACROS_NOWARNING_TEST_SOURCE}) + + + # MACROS LOG TEST NO ERROR + set(LOGMACROS_NOERROR_TEST_SOURCE LogMacrosNoErrorTests.cpp) + + set(LOGMACROS_SOURCE + ${LOG_COMMON_SOURCE} + ${LOGMACROS_NOERROR_TEST_SOURCE}) + + add_executable(LogMacrosNoErrorTests ${LOGMACROS_SOURCE}) + target_compile_definitions(LogMacrosNoErrorTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(LogMacrosNoErrorTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(LogMacrosNoErrorTests GTest::gtest ${MOCKS} + $<$:iphlpapi$Shlwapi> + ) + add_gtest(LogMacrosNoErrorTests SOURCES ${LOGMACROS_NOERROR_TEST_SOURCE}) + + + # MACROS LOG TEST NO DEFAULT + set(LOGMACROS_DEFAULT_TEST_SOURCE LogMacrosDefaultTests.cpp) + + set(LOGMACROS_SOURCE + ${LOG_COMMON_SOURCE} + ${LOGMACROS_DEFAULT_TEST_SOURCE}) + + add_executable(LogMacrosDefaultTests ${LOGMACROS_SOURCE}) + target_compile_definitions(LogMacrosDefaultTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(LogMacrosDefaultTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(LogMacrosDefaultTests GTest::gtest ${MOCKS} + $<$:iphlpapi$Shlwapi> + ) + add_gtest(LogMacrosDefaultTests SOURCES ${LOGMACROS_DEFAULT_TEST_SOURCE}) + + + # MACROS LOG TEST INTERNALDEBUG + # In case this test fails, it fails de compilation + + set(LOGMACROS_INTERNALDEBUG_TEST_SOURCE LogMacrosInternalDebugOffTests.cpp) + + set(LOGMACROS_SOURCE + ${LOG_COMMON_SOURCE} + ${LOGMACROS_INTERNALDEBUG_TEST_SOURCE}) + + add_executable(LogMacrosInternalDebugOffTests ${LOGMACROS_SOURCE}) + target_compile_definitions(LogMacrosInternalDebugOffTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(LogMacrosInternalDebugOffTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(LogMacrosInternalDebugOffTests GTest::gtest ${MOCKS} + $<$:iphlpapi$Shlwapi> + ) + add_gtest(LogMacrosInternalDebugOffTests SOURCES ${LOGMACROS_INTERNALDEBUG_TEST_SOURCE}) endif() diff --git a/test/unittest/rtps/builtin/CMakeLists.txt b/test/unittest/rtps/builtin/CMakeLists.txt index 56d6a29ddb0..8ec961277fe 100644 --- a/test/unittest/rtps/builtin/CMakeLists.txt +++ b/test/unittest/rtps/builtin/CMakeLists.txt @@ -13,76 +13,72 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - find_package(Threads REQUIRED) + set(BUILTIN_DATA_SERIALIZATION_TESTS_SOURCE BuiltinDataSerializationTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - set(BUILTIN_DATA_SERIALIZATION_TESTS_SOURCE BuiltinDataSerializationTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/data/ReaderProxyData.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/data/WriterProxyData.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/data/ReaderProxyData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/data/WriterProxyData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp + ) - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp - ) - - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - endif() - - add_executable(BuiltinDataSerializationTests ${BUILTIN_DATA_SERIALIZATION_TESTS_SOURCE}) - target_compile_definitions(BuiltinDataSerializationTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(BuiltinDataSerializationTests PRIVATE - ${PROJECT_SOURCE_DIR}/test/mock/rtps/NetworkFactory - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) - target_link_libraries(BuiltinDataSerializationTests foonathan_memory - GTest::gmock - ${CMAKE_DL_LIBS}) - if(MSVC OR MSVC_IDE) - target_link_libraries(BuiltinDataSerializationTests ${PRIVACY} fastcdr iphlpapi Shlwapi ws2_32) - else() - target_link_libraries(BuiltinDataSerializationTests ${PRIVACY} fastcdr) - endif() + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) + endif() - add_gtest(BuiltinDataSerializationTests SOURCES ${BUILTIN_DATA_SERIALIZATION_TESTS_SOURCE}) + add_executable(BuiltinDataSerializationTests ${BUILTIN_DATA_SERIALIZATION_TESTS_SOURCE}) + target_compile_definitions(BuiltinDataSerializationTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(BuiltinDataSerializationTests PRIVATE + ${PROJECT_SOURCE_DIR}/test/mock/rtps/NetworkFactory + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) + target_link_libraries(BuiltinDataSerializationTests foonathan_memory + GTest::gmock + ${CMAKE_DL_LIBS}) + if(MSVC OR MSVC_IDE) + target_link_libraries(BuiltinDataSerializationTests ${PRIVACY} fastcdr iphlpapi Shlwapi ws2_32) + else() + target_link_libraries(BuiltinDataSerializationTests ${PRIVACY} fastcdr) endif() + + add_gtest(BuiltinDataSerializationTests SOURCES ${BUILTIN_DATA_SERIALIZATION_TESTS_SOURCE}) endif() diff --git a/test/unittest/rtps/common/CMakeLists.txt b/test/unittest/rtps/common/CMakeLists.txt index 558c6f13916..037e6d658f0 100644 --- a/test/unittest/rtps/common/CMakeLists.txt +++ b/test/unittest/rtps/common/CMakeLists.txt @@ -13,66 +13,64 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - set(CACHECHANGETESTS_SOURCE CacheChangeTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp) - set(GUID_UTILS_TESTS_SOURCE GuidUtilsTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp) - set(SEQUENCENUMBERTESTS_SOURCE SequenceNumberTests.cpp) - set(PORTPARAMETERSTESTS_SOURCE PortParametersTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp) + set(CACHECHANGETESTS_SOURCE CacheChangeTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp) + set(GUID_UTILS_TESTS_SOURCE GuidUtilsTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp) + set(SEQUENCENUMBERTESTS_SOURCE SequenceNumberTests.cpp) + set(PORTPARAMETERSTESTS_SOURCE PortParametersTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp) - add_executable(CacheChangeTests ${CACHECHANGETESTS_SOURCE}) - target_compile_definitions(CacheChangeTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(CacheChangeTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(CacheChangeTests GTest::gtest) - add_gtest(CacheChangeTests SOURCES ${CACHECHANGETESTS_SOURCE}) + add_executable(CacheChangeTests ${CACHECHANGETESTS_SOURCE}) + target_compile_definitions(CacheChangeTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(CacheChangeTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(CacheChangeTests GTest::gtest) + add_gtest(CacheChangeTests SOURCES ${CACHECHANGETESTS_SOURCE}) - add_executable(GuidUtilsTests ${GUID_UTILS_TESTS_SOURCE}) - target_compile_definitions(GuidUtilsTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(GuidUtilsTests PRIVATE - ${PROJECT_SOURCE_DIR}/src/cpp - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(GuidUtilsTests GTest::gtest) - if(MSVC OR MSVC_IDE) - target_link_libraries(GuidUtilsTests ws2_32) - endif() - add_gtest(GuidUtilsTests SOURCES ${GUID_UTILS_TESTS_SOURCE}) + add_executable(GuidUtilsTests ${GUID_UTILS_TESTS_SOURCE}) + target_compile_definitions(GuidUtilsTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(GuidUtilsTests PRIVATE + ${PROJECT_SOURCE_DIR}/src/cpp + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(GuidUtilsTests GTest::gtest) + if(MSVC OR MSVC_IDE) + target_link_libraries(GuidUtilsTests ws2_32) + endif() + add_gtest(GuidUtilsTests SOURCES ${GUID_UTILS_TESTS_SOURCE}) - add_executable(SequenceNumberTests ${SEQUENCENUMBERTESTS_SOURCE}) - target_compile_definitions(SequenceNumberTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(SequenceNumberTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(SequenceNumberTests GTest::gtest) - add_gtest(SequenceNumberTests SOURCES ${SEQUENCENUMBERTESTS_SOURCE}) + add_executable(SequenceNumberTests ${SEQUENCENUMBERTESTS_SOURCE}) + target_compile_definitions(SequenceNumberTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(SequenceNumberTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(SequenceNumberTests GTest::gtest) + add_gtest(SequenceNumberTests SOURCES ${SEQUENCENUMBERTESTS_SOURCE}) - add_executable(PortParametersTests ${PORTPARAMETERSTESTS_SOURCE}) - target_compile_definitions(PortParametersTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(PortParametersTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(PortParametersTests GTest::gtest) - add_gtest(PortParametersTests SOURCES ${PORTPARAMETERSTESTS_SOURCE} LABELS "NoMemoryCheck") - endif() + add_executable(PortParametersTests ${PORTPARAMETERSTESTS_SOURCE}) + target_compile_definitions(PortParametersTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(PortParametersTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(PortParametersTests GTest::gtest) + add_gtest(PortParametersTests SOURCES ${PORTPARAMETERSTESTS_SOURCE} LABELS "NoMemoryCheck") endif() diff --git a/test/unittest/rtps/discovery/CMakeLists.txt b/test/unittest/rtps/discovery/CMakeLists.txt index 2f0441d73c4..6fff4c7b8b3 100644 --- a/test/unittest/rtps/discovery/CMakeLists.txt +++ b/test/unittest/rtps/discovery/CMakeLists.txt @@ -13,84 +13,80 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - find_package(Threads REQUIRED) + set(EDPTESTS_SOURCE EdpTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/StringMatching.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp + ) - set(EDPTESTS_SOURCE EdpTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/StringMatching.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp - ) - - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - endif() - - add_executable(EdpTests ${EDPTESTS_SOURCE}) - target_compile_definitions(EdpTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(EdpTests PRIVATE - ${PROJECT_SOURCE_DIR}/test/mock/rtps/PDP - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSParticipantImpl - ${PROJECT_SOURCE_DIR}/test/mock/rtps/Endpoint - ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderProxyData - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSReader - ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatefulReader - ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderHistory - ${PROJECT_SOURCE_DIR}/test/mock/rtps/WriterProxyData - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSWriter - ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatefulWriter - ${PROJECT_SOURCE_DIR}/test/mock/rtps/WriterHistory - ${PROJECT_SOURCE_DIR}/test/mock/rtps/TimedEvent - ${PROJECT_SOURCE_DIR}/test/mock/rtps/ResourceEvent - ${PROJECT_SOURCE_DIR}/test/mock/rtps/SecurityManager - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) - target_link_libraries(EdpTests foonathan_memory - GTest::gmock - ${CMAKE_DL_LIBS}) - if(MSVC OR MSVC_IDE) - target_link_libraries(EdpTests ${PRIVACY} fastcdr iphlpapi Shlwapi ws2_32) - else() - target_link_libraries(EdpTests ${PRIVACY} fastcdr) - endif() + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) + endif() - add_gtest(EdpTests SOURCES ${EDPTESTS_SOURCE}) + add_executable(EdpTests ${EDPTESTS_SOURCE}) + target_compile_definitions(EdpTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(EdpTests PRIVATE + ${PROJECT_SOURCE_DIR}/test/mock/rtps/PDP + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSParticipantImpl + ${PROJECT_SOURCE_DIR}/test/mock/rtps/Endpoint + ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderProxyData + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSReader + ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatefulReader + ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderHistory + ${PROJECT_SOURCE_DIR}/test/mock/rtps/WriterProxyData + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSWriter + ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatefulWriter + ${PROJECT_SOURCE_DIR}/test/mock/rtps/WriterHistory + ${PROJECT_SOURCE_DIR}/test/mock/rtps/TimedEvent + ${PROJECT_SOURCE_DIR}/test/mock/rtps/ResourceEvent + ${PROJECT_SOURCE_DIR}/test/mock/rtps/SecurityManager + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) + target_link_libraries(EdpTests foonathan_memory + GTest::gmock + ${CMAKE_DL_LIBS}) + if(MSVC OR MSVC_IDE) + target_link_libraries(EdpTests ${PRIVACY} fastcdr iphlpapi Shlwapi ws2_32) + else() + target_link_libraries(EdpTests ${PRIVACY} fastcdr) endif() + + add_gtest(EdpTests SOURCES ${EDPTESTS_SOURCE}) endif() diff --git a/test/unittest/rtps/flowcontrol/CMakeLists.txt b/test/unittest/rtps/flowcontrol/CMakeLists.txt index c38e4224b38..fee0503f0f4 100644 --- a/test/unittest/rtps/flowcontrol/CMakeLists.txt +++ b/test/unittest/rtps/flowcontrol/CMakeLists.txt @@ -13,97 +13,95 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - endif() + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) + endif() - set(FLOWCONTROLLER_COMMON_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/LocatorSelectorSender.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp - ) + set(FLOWCONTROLLER_COMMON_SOURCE + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/LocatorSelectorSender.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp + ) - set(FLOWCONTROLLERFACTORYTESTS_SOURCE - ${FLOWCONTROLLER_COMMON_SOURCE} - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerFactory.cpp - FlowControllerFactoryTests.cpp - ) + set(FLOWCONTROLLERFACTORYTESTS_SOURCE + ${FLOWCONTROLLER_COMMON_SOURCE} + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerFactory.cpp + FlowControllerFactoryTests.cpp + ) - add_executable(FlowControllerFactoryTests ${FLOWCONTROLLERFACTORYTESTS_SOURCE}) - target_compile_definitions(FlowControllerFactoryTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. + add_executable(FlowControllerFactoryTests ${FLOWCONTROLLERFACTORYTESTS_SOURCE}) + target_compile_definitions(FlowControllerFactoryTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(FlowControllerFactoryTests PRIVATE + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSWriter + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSMessageGroup + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) + target_link_libraries(FlowControllerFactoryTests GTest::gmock) + if(MSVC OR MSVC_IDE) + target_link_libraries(FlowControllerFactoryTests ${PRIVACY} + iphlpapi Shlwapi ) - target_include_directories(FlowControllerFactoryTests PRIVATE - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSWriter - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSMessageGroup - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) - target_link_libraries(FlowControllerFactoryTests GTest::gmock) - if(MSVC OR MSVC_IDE) - target_link_libraries(FlowControllerFactoryTests ${PRIVACY} - iphlpapi Shlwapi - ) - endif() - add_gtest(FlowControllerFactoryTests SOURCES ${FLOWCONTROLLERFACTORYTESTS_SOURCE}) + endif() + add_gtest(FlowControllerFactoryTests SOURCES ${FLOWCONTROLLERFACTORYTESTS_SOURCE}) - set(FLOWCONTROLLERPUBLISHMODESTESTS_SOURCE - ${FLOWCONTROLLER_COMMON_SOURCE} - FlowControllerPublishModesOnPureSyncTests.cpp - FlowControllerPublishModesOnSyncTests.cpp - FlowControllerPublishModesOnAsyncTests.cpp - FlowControllerPublishModesOnLimitedAsyncTests.cpp - FlowControllerPublishModesTests.cpp - ) + set(FLOWCONTROLLERPUBLISHMODESTESTS_SOURCE + ${FLOWCONTROLLER_COMMON_SOURCE} + FlowControllerPublishModesOnPureSyncTests.cpp + FlowControllerPublishModesOnSyncTests.cpp + FlowControllerPublishModesOnAsyncTests.cpp + FlowControllerPublishModesOnLimitedAsyncTests.cpp + FlowControllerPublishModesTests.cpp + ) - add_executable(FlowControllerPublishModesTests ${FLOWCONTROLLERPUBLISHMODESTESTS_SOURCE}) - target_compile_definitions(FlowControllerPublishModesTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(FlowControllerPublishModesTests PRIVATE - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSWriter - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSMessageGroup - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp + add_executable(FlowControllerPublishModesTests ${FLOWCONTROLLERPUBLISHMODESTESTS_SOURCE}) + target_compile_definitions(FlowControllerPublishModesTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(FlowControllerPublishModesTests PRIVATE + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSWriter + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSMessageGroup + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) + target_link_libraries(FlowControllerPublishModesTests GTest::gmock) + if(MSVC OR MSVC_IDE) + target_link_libraries(FlowControllerPublishModesTests ${PRIVACY} + iphlpapi Shlwapi ) - target_link_libraries(FlowControllerPublishModesTests GTest::gmock) - if(MSVC OR MSVC_IDE) - target_link_libraries(FlowControllerPublishModesTests ${PRIVACY} - iphlpapi Shlwapi - ) - endif() - add_gtest(FlowControllerPublishModesTests SOURCES ${FLOWCONTROLLERPUBLISHMODESTESTS_SOURCE}) + endif() + add_gtest(FlowControllerPublishModesTests SOURCES ${FLOWCONTROLLERPUBLISHMODESTESTS_SOURCE}) - set(FLOWCONTROLLERSCHEDULERSTESTS_SOURCE - ${FLOWCONTROLLER_COMMON_SOURCE} - FlowControllerSchedulersTests.cpp - ) + set(FLOWCONTROLLERSCHEDULERSTESTS_SOURCE + ${FLOWCONTROLLER_COMMON_SOURCE} + FlowControllerSchedulersTests.cpp + ) - add_executable(FlowControllerSchedulersTests ${FLOWCONTROLLERSCHEDULERSTESTS_SOURCE}) - target_compile_definitions(FlowControllerSchedulersTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(FlowControllerSchedulersTests PRIVATE - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSWriter - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSMessageGroup - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp + add_executable(FlowControllerSchedulersTests ${FLOWCONTROLLERSCHEDULERSTESTS_SOURCE}) + target_compile_definitions(FlowControllerSchedulersTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(FlowControllerSchedulersTests PRIVATE + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSWriter + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSMessageGroup + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) + target_link_libraries(FlowControllerSchedulersTests GTest::gmock) + if(MSVC OR MSVC_IDE) + target_link_libraries(FlowControllerSchedulersTests ${PRIVACY} + iphlpapi Shlwapi ) - target_link_libraries(FlowControllerSchedulersTests GTest::gmock) - if(MSVC OR MSVC_IDE) - target_link_libraries(FlowControllerSchedulersTests ${PRIVACY} - iphlpapi Shlwapi - ) - endif() - add_gtest(FlowControllerSchedulersTests SOURCES ${FLOWCONTROLLERSCHEDULERSTESTS_SOURCE}) endif() + add_gtest(FlowControllerSchedulersTests SOURCES ${FLOWCONTROLLERSCHEDULERSTESTS_SOURCE}) endif() diff --git a/test/unittest/rtps/history/CMakeLists.txt b/test/unittest/rtps/history/CMakeLists.txt index 198da01a287..534bfd367c2 100644 --- a/test/unittest/rtps/history/CMakeLists.txt +++ b/test/unittest/rtps/history/CMakeLists.txt @@ -13,104 +13,99 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - find_package(Threads REQUIRED) + set(READERHISTORYTESTS_SOURCE ReaderHistoryTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/ReaderHistory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/History.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/CacheChangePool.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp) - set(READERHISTORYTESTS_SOURCE ReaderHistoryTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/ReaderHistory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/History.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/CacheChangePool.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp) + set(BASICPOOLSTESTS_SOURCE BasicPoolsTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/CacheChangePool.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp) - set(BASICPOOLSTESTS_SOURCE BasicPoolsTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/CacheChangePool.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp) + set(CACHECHANGEPOOLTESTS_SOURCE CacheChangePoolTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/CacheChangePool.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp) - set(CACHECHANGEPOOLTESTS_SOURCE CacheChangePoolTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/CacheChangePool.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp) + set(TOPICPAYLOADPOOLTESTS_SOURCE + TopicPayloadPoolTests.cpp TopicPayloadPoolRegistryTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPool.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPoolRegistry.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp) - set(TOPICPAYLOADPOOLTESTS_SOURCE - TopicPayloadPoolTests.cpp TopicPayloadPoolRegistryTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPool.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPoolRegistry.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp) - - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - endif() - - add_executable(ReaderHistoryTests ${READERHISTORYTESTS_SOURCE}) - target_compile_definitions(ReaderHistoryTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(ReaderHistoryTests PRIVATE - ${PROJECT_SOURCE_DIR}/test/mock/rtps/Endpoint - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSReader - ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatefulReader - ${PROJECT_SOURCE_DIR}/src/cpp - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(ReaderHistoryTests - GTest::gmock - ${CMAKE_DL_LIBS}) - add_gtest(ReaderHistoryTests SOURCES ${READERHISTORYTESTS_SOURCE}) + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) + endif() - add_executable(BasicPoolsTests ${BASICPOOLSTESTS_SOURCE}) - target_compile_definitions(BasicPoolsTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(BasicPoolsTests PRIVATE - ${PROJECT_SOURCE_DIR}/src/cpp - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(BasicPoolsTests - GTest::gtest - ${CMAKE_DL_LIBS}) - add_gtest(BasicPoolsTests SOURCES ${BASICPOOLSTESTS_SOURCE}) + add_executable(ReaderHistoryTests ${READERHISTORYTESTS_SOURCE}) + target_compile_definitions(ReaderHistoryTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(ReaderHistoryTests PRIVATE + ${PROJECT_SOURCE_DIR}/test/mock/rtps/Endpoint + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSReader + ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatefulReader + ${PROJECT_SOURCE_DIR}/src/cpp + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(ReaderHistoryTests + GTest::gmock + ${CMAKE_DL_LIBS}) + add_gtest(ReaderHistoryTests SOURCES ${READERHISTORYTESTS_SOURCE}) - add_executable(CacheChangePoolTests ${CACHECHANGEPOOLTESTS_SOURCE}) - target_compile_definitions(CacheChangePoolTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(CacheChangePoolTests PRIVATE - ${PROJECT_SOURCE_DIR}/src/cpp - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(CacheChangePoolTests - GTest::gtest - ${CMAKE_DL_LIBS}) - add_gtest(CacheChangePoolTests SOURCES ${CACHECHANGEPOOLTESTS_SOURCE}) + add_executable(BasicPoolsTests ${BASICPOOLSTESTS_SOURCE}) + target_compile_definitions(BasicPoolsTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(BasicPoolsTests PRIVATE + ${PROJECT_SOURCE_DIR}/src/cpp + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(BasicPoolsTests + GTest::gtest + ${CMAKE_DL_LIBS}) + add_gtest(BasicPoolsTests SOURCES ${BASICPOOLSTESTS_SOURCE}) - add_executable(TopicPayloadPoolTests ${TOPICPAYLOADPOOLTESTS_SOURCE}) - target_compile_definitions(TopicPayloadPoolTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(TopicPayloadPoolTests PRIVATE - ${PROJECT_SOURCE_DIR}/test/mock/rtps/TopicPayloadPoolProxy - ${PROJECT_SOURCE_DIR}/src/cpp - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(TopicPayloadPoolTests - GTest::gtest - ${CMAKE_DL_LIBS}) - add_gtest(TopicPayloadPoolTests SOURCES ${TOPICPAYLOADPOOLTESTS_SOURCE}) + add_executable(CacheChangePoolTests ${CACHECHANGEPOOLTESTS_SOURCE}) + target_compile_definitions(CacheChangePoolTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(CacheChangePoolTests PRIVATE + ${PROJECT_SOURCE_DIR}/src/cpp + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(CacheChangePoolTests + GTest::gtest + ${CMAKE_DL_LIBS}) + add_gtest(CacheChangePoolTests SOURCES ${CACHECHANGEPOOLTESTS_SOURCE}) - endif() + add_executable(TopicPayloadPoolTests ${TOPICPAYLOADPOOLTESTS_SOURCE}) + target_compile_definitions(TopicPayloadPoolTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(TopicPayloadPoolTests PRIVATE + ${PROJECT_SOURCE_DIR}/test/mock/rtps/TopicPayloadPoolProxy + ${PROJECT_SOURCE_DIR}/src/cpp + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(TopicPayloadPoolTests + GTest::gtest + ${CMAKE_DL_LIBS}) + add_gtest(TopicPayloadPoolTests SOURCES ${TOPICPAYLOADPOOLTESTS_SOURCE}) endif() diff --git a/test/unittest/rtps/network/CMakeLists.txt b/test/unittest/rtps/network/CMakeLists.txt index 6fff501ff82..5733b657073 100644 --- a/test/unittest/rtps/network/CMakeLists.txt +++ b/test/unittest/rtps/network/CMakeLists.txt @@ -13,89 +13,84 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - find_package(Threads REQUIRED) - - set(NETWORKFACTORYTESTS_SOURCE - NetworkFactoryTests.cpp - mock/MockTransport.cpp - - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/ChannelResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPChannelResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPTransportInterface.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPv4Transport.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPv6Transport.cpp - - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/tcp/RTCPMessageManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/tcp/TCPControlMessage.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResourceBasic.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptorBasic.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPTransportInterface.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPv4Transport.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPv6Transport.cpp - - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/messages/RTPSMessageCreator.cpp - - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/ResourceEvent.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEvent.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEventImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp - - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/NetworkFactory.cpp - - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/System.cpp + set(NETWORKFACTORYTESTS_SOURCE + NetworkFactoryTests.cpp + mock/MockTransport.cpp + + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/ChannelResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPChannelResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPTransportInterface.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPv4Transport.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPv6Transport.cpp + + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/tcp/RTCPMessageManager.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/tcp/TCPControlMessage.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResourceBasic.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptorBasic.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPTransportInterface.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPv4Transport.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPv6Transport.cpp + + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/messages/RTPSMessageCreator.cpp + + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp + + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/ResourceEvent.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEvent.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEventImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp + + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/NetworkFactory.cpp + + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/System.cpp ) - if(TLS_FOUND) - set(NETWORKFACTORYTESTS_SOURCE - ${NETWORKFACTORYTESTS_SOURCE} - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResourceSecure.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptorSecure.cpp - ) - endif() - - include_directories(mock/) - - add_executable(NetworkFactoryTests ${NETWORKFACTORYTESTS_SOURCE}) - target_compile_definitions(NetworkFactoryTests PRIVATE FASTRTPS_NO_LIB - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(NetworkFactoryTests PRIVATE - ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/test/mock/rtps/ParticipantProxyData - ${PROJECT_SOURCE_DIR}/test/mock/dds/QosPolicies - ${PROJECT_SOURCE_DIR}/test/mock/rtps/MessageReceiver - ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReceiverResource - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp + if(TLS_FOUND) + set(NETWORKFACTORYTESTS_SOURCE + ${NETWORKFACTORYTESTS_SOURCE} + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResourceSecure.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptorSecure.cpp ) - target_link_libraries(NetworkFactoryTests fastcdr foonathan_memory - GTest::gtest ${MOCKS} - $<$:OpenSSL::SSL$OpenSSL::Crypto> - ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) - - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - target_link_libraries(NetworkFactoryTests IPHLPAPI shlwapi) # Later so mocks have precedence - endif() + endif() - add_gtest(NetworkFactoryTests SOURCES ${NETWORKFACTORYTESTS_SOURCE}) + include_directories(mock/) + add_executable(NetworkFactoryTests ${NETWORKFACTORYTESTS_SOURCE}) + target_compile_definitions(NetworkFactoryTests PRIVATE FASTRTPS_NO_LIB + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(NetworkFactoryTests PRIVATE + ${Asio_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/test/mock/rtps/ParticipantProxyData + ${PROJECT_SOURCE_DIR}/test/mock/dds/QosPolicies + ${PROJECT_SOURCE_DIR}/test/mock/rtps/MessageReceiver + ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReceiverResource + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) + target_link_libraries(NetworkFactoryTests fastcdr foonathan_memory + GTest::gtest ${MOCKS} + $<$:OpenSSL::SSL$OpenSSL::Crypto> + ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) + + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) + target_link_libraries(NetworkFactoryTests IPHLPAPI shlwapi) # Later so mocks have precedence endif() + + add_gtest(NetworkFactoryTests SOURCES ${NETWORKFACTORYTESTS_SOURCE}) endif() diff --git a/test/unittest/rtps/persistence/CMakeLists.txt b/test/unittest/rtps/persistence/CMakeLists.txt index 72a4b859b63..42453a07ace 100644 --- a/test/unittest/rtps/persistence/CMakeLists.txt +++ b/test/unittest/rtps/persistence/CMakeLists.txt @@ -13,7 +13,7 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND AND SQLITE3_SUPPORT) + if(SQLITE3_SUPPORT) set(PERSISTENCETESTS_SOURCE PersistenceTests.cpp ${PROJECT_SOURCE_DIR}/src/cpp/rtps/persistence/PersistenceFactory.cpp diff --git a/test/unittest/rtps/reader/CMakeLists.txt b/test/unittest/rtps/reader/CMakeLists.txt index fa8569cf3dd..591b15785eb 100644 --- a/test/unittest/rtps/reader/CMakeLists.txt +++ b/test/unittest/rtps/reader/CMakeLists.txt @@ -13,45 +13,41 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - find_package(Threads REQUIRED) + set(WRITERPROXYTESTS_SOURCE WriterProxyTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ) - set(WRITERPROXYTESTS_SOURCE WriterProxyTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ) - - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - endif() - - add_executable(WriterProxyTests ${WRITERPROXYTESTS_SOURCE}) - target_compile_definitions(WriterProxyTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(WriterProxyTests PRIVATE - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/reader - ${PROJECT_SOURCE_DIR}/test/mock/rtps/Endpoint - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSReader - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSWriter - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSParticipantImpl - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl - ${PROJECT_SOURCE_DIR}/test/mock/rtps/TimedEvent - ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatefulReader - ${PROJECT_SOURCE_DIR}/test/mock/rtps/WriterProxyData - ${PROJECT_SOURCE_DIR}/test/mock/dds/QosPolicies - ${PROJECT_SOURCE_DIR}/test/mock/rtps/ResourceEvent - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) - target_link_libraries(WriterProxyTests foonathan_memory - GTest::gmock - ${CMAKE_DL_LIBS}) - add_gtest(WriterProxyTests SOURCES ${WRITERPROXYTESTS_SOURCE}) + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) endif() + + add_executable(WriterProxyTests ${WRITERPROXYTESTS_SOURCE}) + target_compile_definitions(WriterProxyTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(WriterProxyTests PRIVATE + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/reader + ${PROJECT_SOURCE_DIR}/test/mock/rtps/Endpoint + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSReader + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSWriter + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSParticipantImpl + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSDomainImpl + ${PROJECT_SOURCE_DIR}/test/mock/rtps/TimedEvent + ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatefulReader + ${PROJECT_SOURCE_DIR}/test/mock/rtps/WriterProxyData + ${PROJECT_SOURCE_DIR}/test/mock/dds/QosPolicies + ${PROJECT_SOURCE_DIR}/test/mock/rtps/ResourceEvent + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) + target_link_libraries(WriterProxyTests foonathan_memory + GTest::gmock + ${CMAKE_DL_LIBS}) + add_gtest(WriterProxyTests SOURCES ${WRITERPROXYTESTS_SOURCE}) endif() diff --git a/test/unittest/rtps/resources/timedevent/CMakeLists.txt b/test/unittest/rtps/resources/timedevent/CMakeLists.txt index 8b124336466..faf0b358f39 100644 --- a/test/unittest/rtps/resources/timedevent/CMakeLists.txt +++ b/test/unittest/rtps/resources/timedevent/CMakeLists.txt @@ -13,40 +13,36 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - find_package(Threads REQUIRED) + set(TIMEDEVENTTESTS_SOURCE mock/MockEvent.cpp + TimedEventTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEventImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEvent.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/ResourceEvent.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ) - set(TIMEDEVENTTESTS_SOURCE mock/MockEvent.cpp - TimedEventTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEventImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEvent.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/ResourceEvent.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ) - - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - endif() - - add_executable(TimedEventTests ${TIMEDEVENTTESTS_SOURCE}) - target_compile_definitions(TimedEventTests PRIVATE FASTRTPS_NO_LIB - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(TimedEventTests PRIVATE - ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/include - ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) - target_link_libraries(TimedEventTests GTest::gtest ${CMAKE_DL_LIBS}) - add_gtest(TimedEventTests SOURCES ${TIMEDEVENTTESTS_SOURCE}) + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) endif() + + add_executable(TimedEventTests ${TIMEDEVENTTESTS_SOURCE}) + target_compile_definitions(TimedEventTests PRIVATE FASTRTPS_NO_LIB + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(TimedEventTests PRIVATE + ${Asio_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/include + ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) + target_link_libraries(TimedEventTests GTest::gtest ${CMAKE_DL_LIBS}) + add_gtest(TimedEventTests SOURCES ${TIMEDEVENTTESTS_SOURCE}) endif() diff --git a/test/unittest/rtps/security/CMakeLists.txt b/test/unittest/rtps/security/CMakeLists.txt index 9e9d8e2de91..e8592daa515 100644 --- a/test/unittest/rtps/security/CMakeLists.txt +++ b/test/unittest/rtps/security/CMakeLists.txt @@ -13,88 +13,86 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - endif() - - set(SOURCES_SECURITY_TEST_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/logging/Logging.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPool.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPoolRegistry.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/LocatorSelectorSender.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEvent.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEventImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/ResourceEvent.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Token.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/exceptions/Exception.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/SecurityManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/exceptions/SecurityException.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp - ${PROJECT_SOURCE_DIR}/test/mock/rtps/SecurityPluginFactory/rtps/security/SecurityPluginFactory.cpp - ) + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) + endif() - add_executable(SecurityAuthentication ${SOURCES_SECURITY_TEST_SOURCE} - ${CMAKE_CURRENT_SOURCE_DIR}/SecurityTests.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/SecurityInitializationTests.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/SecurityValidationRemoteTests.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/SecurityHandshakeProcessTests.cpp) + set(SOURCES_SECURITY_TEST_SOURCE + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/logging/Logging.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPool.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPoolRegistry.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/LocatorSelectorSender.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEvent.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEventImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/ResourceEvent.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Token.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/exceptions/Exception.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/SecurityManager.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/exceptions/SecurityException.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp + ${PROJECT_SOURCE_DIR}/test/mock/rtps/SecurityPluginFactory/rtps/security/SecurityPluginFactory.cpp + ) - if(WIN32) - set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/SecurityInitializationTests.cpp PROPERTIES COMPILE_OPTIONS /bigobj) - set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/SecurityHandshakeProcessTests.cpp PROPERTIES COMPILE_OPTIONS /bigobj) - set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/SecurityValidationRemoteTests.cpp PROPERTIES COMPILE_OPTIONS /bigobj) - set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/SecurityInitializationTests.cpp PROPERTIES COMPILE_OPTIONS /bigobj) - endif() + add_executable(SecurityAuthentication ${SOURCES_SECURITY_TEST_SOURCE} + ${CMAKE_CURRENT_SOURCE_DIR}/SecurityTests.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/SecurityInitializationTests.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/SecurityValidationRemoteTests.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/SecurityHandshakeProcessTests.cpp) - target_compile_definitions(SecurityAuthentication PRIVATE FASTRTPS_NO_LIB - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(SecurityAuthentication PRIVATE - ${Asio_INCLUDE_DIR} - ${OPENSSL_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/test/mock/rtps/SecurityPluginFactory - ${PROJECT_SOURCE_DIR}/test/mock/rtps/Endpoint - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSParticipantImpl - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSWriter - ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatelessWriter - ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatefulWriter - ${PROJECT_SOURCE_DIR}/test/mock/rtps/WriterHistory - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSReader - ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatelessReader - ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatefulReader - ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderHistory - ${PROJECT_SOURCE_DIR}/test/mock/rtps/PDPSimple - ${PROJECT_SOURCE_DIR}/test/mock/rtps/EDP - ${PROJECT_SOURCE_DIR}/test/mock/rtps/ParticipantProxyData - ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderProxyData - ${PROJECT_SOURCE_DIR}/test/mock/rtps/WriterProxyData - ${PROJECT_SOURCE_DIR}/test/mock/dds/QosPolicies - ${PROJECT_SOURCE_DIR}/test/mock/rtps/NetworkFactory - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) - target_link_libraries(SecurityAuthentication fastcdr - GTest::gmock - ${OPENSSL_LIBRARIES} - ) - add_gtest(SecurityAuthentication - SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/SecurityInitializationTests.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/SecurityValidationRemoteTests.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/SecurityHandshakeProcessTests.cpp) + if(WIN32) + set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/SecurityInitializationTests.cpp PROPERTIES COMPILE_OPTIONS /bigobj) + set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/SecurityHandshakeProcessTests.cpp PROPERTIES COMPILE_OPTIONS /bigobj) + set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/SecurityValidationRemoteTests.cpp PROPERTIES COMPILE_OPTIONS /bigobj) + set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/SecurityInitializationTests.cpp PROPERTIES COMPILE_OPTIONS /bigobj) endif() + + target_compile_definitions(SecurityAuthentication PRIVATE FASTRTPS_NO_LIB + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(SecurityAuthentication PRIVATE + ${Asio_INCLUDE_DIR} + ${OPENSSL_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/test/mock/rtps/SecurityPluginFactory + ${PROJECT_SOURCE_DIR}/test/mock/rtps/Endpoint + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSParticipantImpl + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSWriter + ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatelessWriter + ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatefulWriter + ${PROJECT_SOURCE_DIR}/test/mock/rtps/WriterHistory + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSReader + ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatelessReader + ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatefulReader + ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderHistory + ${PROJECT_SOURCE_DIR}/test/mock/rtps/PDPSimple + ${PROJECT_SOURCE_DIR}/test/mock/rtps/EDP + ${PROJECT_SOURCE_DIR}/test/mock/rtps/ParticipantProxyData + ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderProxyData + ${PROJECT_SOURCE_DIR}/test/mock/rtps/WriterProxyData + ${PROJECT_SOURCE_DIR}/test/mock/dds/QosPolicies + ${PROJECT_SOURCE_DIR}/test/mock/rtps/NetworkFactory + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) + target_link_libraries(SecurityAuthentication fastcdr + GTest::gmock + ${OPENSSL_LIBRARIES} + ) + add_gtest(SecurityAuthentication + SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/SecurityInitializationTests.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/SecurityValidationRemoteTests.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/SecurityHandshakeProcessTests.cpp) endif() diff --git a/test/unittest/rtps/writer/CMakeLists.txt b/test/unittest/rtps/writer/CMakeLists.txt index b04dfc3b566..51ab90b70d6 100644 --- a/test/unittest/rtps/writer/CMakeLists.txt +++ b/test/unittest/rtps/writer/CMakeLists.txt @@ -13,104 +13,100 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) + # ReaderProxy + set(WRITERPROXYTESTS_SOURCE ReaderProxyTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/ReaderProxy.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/LocatorSelectorSender.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp + ) - # ReaderProxy - set(WRITERPROXYTESTS_SOURCE ReaderProxyTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/ReaderProxy.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/LocatorSelectorSender.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp - ) - - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - endif() + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) + endif() - add_executable(ReaderProxyTests ${WRITERPROXYTESTS_SOURCE}) - target_compile_definitions(ReaderProxyTests PRIVATE FASTRTPS_NO_LIB - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(ReaderProxyTests PRIVATE - ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/test/mock/rtps/Endpoint - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSWriter - ${PROJECT_SOURCE_DIR}/test/mock/rtps/WriterHistory - ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatefulWriter - ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatelessWriter - ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderProxyData - ${PROJECT_SOURCE_DIR}/test/mock/dds/QosPolicies - ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderLocator - ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSGapBuilder - ${PROJECT_SOURCE_DIR}/test/mock/rtps/TimedEvent - ${PROJECT_SOURCE_DIR}/include - ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ${THIRDPARTY_BOOST_INCLUDE_DIR} - ) - target_link_libraries(ReaderProxyTests - GTest::gmock foonathan_memory - ${CMAKE_DL_LIBS} - ${THIRDPARTY_BOOST_LINK_LIBS}) - add_gtest(ReaderProxyTests SOURCES ${WRITERPROXYTESTS_SOURCE}) + add_executable(ReaderProxyTests ${WRITERPROXYTESTS_SOURCE}) + target_compile_definitions(ReaderProxyTests PRIVATE FASTRTPS_NO_LIB + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(ReaderProxyTests PRIVATE + ${Asio_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/test/mock/rtps/Endpoint + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSWriter + ${PROJECT_SOURCE_DIR}/test/mock/rtps/WriterHistory + ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatefulWriter + ${PROJECT_SOURCE_DIR}/test/mock/rtps/StatelessWriter + ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderProxyData + ${PROJECT_SOURCE_DIR}/test/mock/dds/QosPolicies + ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderLocator + ${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSGapBuilder + ${PROJECT_SOURCE_DIR}/test/mock/rtps/TimedEvent + ${PROJECT_SOURCE_DIR}/include + ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ${THIRDPARTY_BOOST_INCLUDE_DIR} + ) + target_link_libraries(ReaderProxyTests + GTest::gmock foonathan_memory + ${CMAKE_DL_LIBS} + ${THIRDPARTY_BOOST_LINK_LIBS}) + add_gtest(ReaderProxyTests SOURCES ${WRITERPROXYTESTS_SOURCE}) # LivelinessManager - set(LIVELINESSMANAGERTESTS_SOURCE LivelinessManagerTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/LivelinessManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/ResourceEvent.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEvent.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEventImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp - ) - add_executable(LivelinessManagerTests ${LIVELINESSMANAGERTESTS_SOURCE}) - target_compile_definitions(LivelinessManagerTests PRIVATE FASTRTPS_NO_LIB - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(LivelinessManagerTests PRIVATE - ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/include - ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) - target_link_libraries(LivelinessManagerTests PRIVATE - GTest::gmock) - add_gtest(LivelinessManagerTests SOURCES ${LIVELINESSMANAGERTESTS_SOURCE}) + set(LIVELINESSMANAGERTESTS_SOURCE LivelinessManagerTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/LivelinessManager.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/ResourceEvent.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEvent.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEventImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp + ) + add_executable(LivelinessManagerTests ${LIVELINESSMANAGERTESTS_SOURCE}) + target_compile_definitions(LivelinessManagerTests PRIVATE FASTRTPS_NO_LIB + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(LivelinessManagerTests PRIVATE + ${Asio_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/include + ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) + target_link_libraries(LivelinessManagerTests PRIVATE + GTest::gmock) + add_gtest(LivelinessManagerTests SOURCES ${LIVELINESSMANAGERTESTS_SOURCE}) # RTPSWriter - set(RTPSWRITERTESTS_SOURCE RTPSWriterTests.cpp) + set(RTPSWRITERTESTS_SOURCE RTPSWriterTests.cpp) - add_executable(RTPSWriterTests ${RTPSWRITERTESTS_SOURCE}) - target_compile_definitions(RTPSWriterTests PRIVATE - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(RTPSWriterTests PRIVATE - ${Asio_INCLUDE_DIR}) - target_link_libraries(RTPSWriterTests fastrtps foonathan_memory - GTest::gmock - ${CMAKE_DL_LIBS}) - add_gtest(RTPSWriterTests SOURCES ${RTPSWRITERTESTS_SOURCE}) - - endif() + add_executable(RTPSWriterTests ${RTPSWRITERTESTS_SOURCE}) + target_compile_definitions(RTPSWriterTests PRIVATE + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(RTPSWriterTests PRIVATE + ${Asio_INCLUDE_DIR}) + target_link_libraries(RTPSWriterTests fastrtps foonathan_memory + GTest::gmock + ${CMAKE_DL_LIBS}) + add_gtest(RTPSWriterTests SOURCES ${RTPSWRITERTESTS_SOURCE}) endif() diff --git a/test/unittest/security/accesscontrol/CMakeLists.txt b/test/unittest/security/accesscontrol/CMakeLists.txt index 5772cbce207..5384f5653dd 100644 --- a/test/unittest/security/accesscontrol/CMakeLists.txt +++ b/test/unittest/security/accesscontrol/CMakeLists.txt @@ -13,95 +13,93 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - if(WIN32) - add_definitions( - -D_WIN32_WINNT=0x0601 - -D_CRT_SECURE_NO_WARNINGS - ) - endif() - - set(COMMON_SOURCES_ACCESS_CONTROL_TEST_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/ResourceEvent.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEvent.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEventImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Token.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/exceptions/Exception.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/exceptions/SecurityException.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/common/SharedSecretHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp//utils/TimedConditionVariable.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/logging/Logging.cpp + if(WIN32) + add_definitions( + -D_WIN32_WINNT=0x0601 + -D_CRT_SECURE_NO_WARNINGS ) + endif() + + set(COMMON_SOURCES_ACCESS_CONTROL_TEST_SOURCE + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/ResourceEvent.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEvent.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEventImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Token.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/exceptions/Exception.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/exceptions/SecurityException.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/common/SharedSecretHandle.cpp + ${PROJECT_SOURCE_DIR}/src/cpp//utils/TimedConditionVariable.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/logging/Logging.cpp + ) - if(TINYXML2_SOURCE_DIR) - list(APPEND COMMON_SOURCES_ACCESS_CONTROL_TEST_SOURCE - ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp + if(TINYXML2_SOURCE_DIR) + list(APPEND COMMON_SOURCES_ACCESS_CONTROL_TEST_SOURCE + ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp ) - endif() + endif() - include_directories(${TINYXML2_INCLUDE_DIR}) + include_directories(${TINYXML2_INCLUDE_DIR}) - add_executable(AccessControlTests ${COMMON_SOURCES_ACCESS_CONTROL_TEST_SOURCE} - ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIDH.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIIdentityHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIHandshakeHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/AccessPermissionsHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/CommonParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/GovernanceParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/Permissions.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/PermissionsParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/StringMatching.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/AccessControlTests.cpp) + add_executable(AccessControlTests ${COMMON_SOURCES_ACCESS_CONTROL_TEST_SOURCE} + ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIDH.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIIdentityHandle.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIHandshakeHandle.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/AccessPermissionsHandle.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/CommonParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/GovernanceParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/Permissions.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/PermissionsParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/StringMatching.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/AccessControlTests.cpp) - target_compile_definitions(AccessControlTests PRIVATE FASTRTPS_NO_LIB - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) + target_compile_definitions(AccessControlTests PRIVATE FASTRTPS_NO_LIB + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) - target_include_directories(AccessControlTests PRIVATE - ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/test/mock/rtps/NetworkFactory/ - ${PROJECT_SOURCE_DIR}/test/mock/rtps/PDPSimple - ${PROJECT_SOURCE_DIR}/test/mock/rtps/EDP - ${PROJECT_SOURCE_DIR}/test/mock/rtps/ParticipantProxyData - ${PROJECT_SOURCE_DIR}/test/mock/rtps/WriterProxyData/ - ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderProxyData/ - ${PROJECT_SOURCE_DIR}/test/mock/dds/QosPolicies - ${OPENSSL_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) + target_include_directories(AccessControlTests PRIVATE + ${Asio_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/test/mock/rtps/NetworkFactory/ + ${PROJECT_SOURCE_DIR}/test/mock/rtps/PDPSimple + ${PROJECT_SOURCE_DIR}/test/mock/rtps/EDP + ${PROJECT_SOURCE_DIR}/test/mock/rtps/ParticipantProxyData + ${PROJECT_SOURCE_DIR}/test/mock/rtps/WriterProxyData/ + ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderProxyData/ + ${PROJECT_SOURCE_DIR}/test/mock/dds/QosPolicies + ${OPENSSL_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) - target_link_libraries(AccessControlTests - GTest::gmock - ${OPENSSL_LIBRARIES} - fastcdr - foonathan_memory - $<$:ws2_32> - ${TINYXML2_LIBRARY} - ) + target_link_libraries(AccessControlTests + GTest::gmock + ${OPENSSL_LIBRARIES} + fastcdr + foonathan_memory + $<$:ws2_32> + ${TINYXML2_LIBRARY} + ) - if(MSVC OR MSVC_IDE) - target_link_libraries(AccessControlTests ${PRIVACY} iphlpapi Shlwapi) - endif() + if(MSVC OR MSVC_IDE) + target_link_libraries(AccessControlTests ${PRIVACY} iphlpapi Shlwapi) + endif() - add_gtest(AccessControlTests - SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/AccessControlTests.cpp - ENVIRONMENTS "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs") - endif() + add_gtest(AccessControlTests + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/AccessControlTests.cpp + ENVIRONMENTS "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs") endif() diff --git a/test/unittest/security/authentication/CMakeLists.txt b/test/unittest/security/authentication/CMakeLists.txt index f080818e689..60aaa141dbf 100644 --- a/test/unittest/security/authentication/CMakeLists.txt +++ b/test/unittest/security/authentication/CMakeLists.txt @@ -13,60 +13,58 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - if(WIN32) - add_definitions( - -D_WIN32_WINNT=0x0601 - -D_CRT_SECURE_NO_WARNINGS - ) - endif() - - set(COMMON_SOURCES_AUTH_PLUGIN_TEST_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/data/ParticipantProxyData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/ResourceEvent.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEvent.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEventImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Token.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/exceptions/Exception.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/exceptions/SecurityException.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/common/SharedSecretHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp//utils/TimedConditionVariable.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/logging/Logging.cpp - ) - - add_executable(BuiltinPKIDH ${COMMON_SOURCES_AUTH_PLUGIN_TEST_SOURCE} - ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIDH.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIIdentityHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIHandshakeHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/BuiltinPKIDHTests.cpp) - target_compile_definitions(BuiltinPKIDH PRIVATE FASTRTPS_NO_LIB - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. + if(WIN32) + add_definitions( + -D_WIN32_WINNT=0x0601 + -D_CRT_SECURE_NO_WARNINGS ) - target_include_directories(BuiltinPKIDH PRIVATE - ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/test/mock/rtps/NetworkFactory/ - ${OPENSSL_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) - target_link_libraries(BuiltinPKIDH GTest::gtest ${OPENSSL_LIBRARIES} fastcdr foonathan_memory $<$:ws2_32>) - add_gtest(BuiltinPKIDH - SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/BuiltinPKIDHTests.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/AuthenticationPluginTests.hpp - ENVIRONMENTS "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs") endif() + + set(COMMON_SOURCES_AUTH_PLUGIN_TEST_SOURCE + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/data/ParticipantProxyData.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/ResourceEvent.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEvent.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEventImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Token.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/exceptions/Exception.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/exceptions/SecurityException.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/common/SharedSecretHandle.cpp + ${PROJECT_SOURCE_DIR}/src/cpp//utils/TimedConditionVariable.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/logging/Logging.cpp + ) + + add_executable(BuiltinPKIDH ${COMMON_SOURCES_AUTH_PLUGIN_TEST_SOURCE} + ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIDH.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIIdentityHandle.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIHandshakeHandle.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/BuiltinPKIDHTests.cpp) + target_compile_definitions(BuiltinPKIDH PRIVATE FASTRTPS_NO_LIB + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(BuiltinPKIDH PRIVATE + ${Asio_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/test/mock/rtps/NetworkFactory/ + ${OPENSSL_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) + target_link_libraries(BuiltinPKIDH GTest::gtest ${OPENSSL_LIBRARIES} fastcdr foonathan_memory $<$:ws2_32>) + add_gtest(BuiltinPKIDH + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/BuiltinPKIDHTests.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/AuthenticationPluginTests.hpp + ENVIRONMENTS "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs") endif() diff --git a/test/unittest/security/cryptography/CMakeLists.txt b/test/unittest/security/cryptography/CMakeLists.txt index 26f02465262..a651091cf47 100644 --- a/test/unittest/security/cryptography/CMakeLists.txt +++ b/test/unittest/security/cryptography/CMakeLists.txt @@ -13,52 +13,50 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - endif() + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) + endif() - set(COMMON_SOURCES_CRYPTO_PLUGIN_TEST_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Token.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/exceptions/Exception.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/exceptions/SecurityException.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/common/SharedSecretHandle.cpp - ) + set(COMMON_SOURCES_CRYPTO_PLUGIN_TEST_SOURCE + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Token.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/exceptions/Exception.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/exceptions/SecurityException.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/common/SharedSecretHandle.cpp + ) - add_executable(BuiltinAESGCMGMAC ${COMMON_SOURCES_CRYPTO_PLUGIN_TEST_SOURCE} - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_KeyExchange.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_KeyFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_Types.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIIdentityHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/AccessPermissionsHandle.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/builtinAESGCMGMACTests.cpp) + add_executable(BuiltinAESGCMGMAC ${COMMON_SOURCES_CRYPTO_PLUGIN_TEST_SOURCE} + ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_KeyExchange.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_KeyFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_Types.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIIdentityHandle.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/AccessPermissionsHandle.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/builtinAESGCMGMACTests.cpp) - target_compile_definitions(BuiltinAESGCMGMAC PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(BuiltinAESGCMGMAC PRIVATE - ${OPENSSL_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) - target_link_libraries(BuiltinAESGCMGMAC fastcdr GTest::gmock ${OPENSSL_LIBRARIES}) - add_gtest(BuiltinAESGCMGMAC SOURCES ${COMMON_SOURCES_CRYPTO_PLUGIN_TEST_SOURCE} - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_KeyExchange.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_KeyFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_Types.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/builtinAESGCMGMACTests.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/CryptographyPluginTests.hpp - ENVIRONMENTS "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs") - endif() + target_compile_definitions(BuiltinAESGCMGMAC PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(BuiltinAESGCMGMAC PRIVATE + ${OPENSSL_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) + target_link_libraries(BuiltinAESGCMGMAC fastcdr GTest::gmock ${OPENSSL_LIBRARIES}) + add_gtest(BuiltinAESGCMGMAC SOURCES ${COMMON_SOURCES_CRYPTO_PLUGIN_TEST_SOURCE} + ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_KeyExchange.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_KeyFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_Types.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/builtinAESGCMGMACTests.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/CryptographyPluginTests.hpp + ENVIRONMENTS "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs") endif() diff --git a/test/unittest/security/logging/CMakeLists.txt b/test/unittest/security/logging/CMakeLists.txt index 57b38746076..626f41babba 100644 --- a/test/unittest/security/logging/CMakeLists.txt +++ b/test/unittest/security/logging/CMakeLists.txt @@ -13,39 +13,37 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - endif() + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) + endif() - set(COMMON_SOURCES_LOGGING_PLUGIN_TEST_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Token.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/exceptions/Exception.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/exceptions/SecurityException.cpp - ) + set(COMMON_SOURCES_LOGGING_PLUGIN_TEST_SOURCE + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Token.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/exceptions/Exception.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/exceptions/SecurityException.cpp + ) - add_executable(BuiltinLogging ${COMMON_SOURCES_LOGGING_PLUGIN_TEST_SOURCE} - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/logging/Logging.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/logging/LogTopic.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/BuiltinLogTopicTests.cpp) + add_executable(BuiltinLogging ${COMMON_SOURCES_LOGGING_PLUGIN_TEST_SOURCE} + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/logging/Logging.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/logging/LogTopic.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/BuiltinLogTopicTests.cpp) - target_compile_definitions(BuiltinLogging PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(BuiltinLogging PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) - target_link_libraries(BuiltinLogging fastcdr GTest::gtest ${OPENSSL_LIBRARIES}) - add_gtest(BuiltinLogging SOURCES ${COMMON_SOURCES_LOGGING_PLUGIN_TEST_SOURCE} - ${CMAKE_CURRENT_SOURCE_DIR}/LoggingPluginTests.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/BuiltinLogTopicTests.cpp) - endif() + target_compile_definitions(BuiltinLogging PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(BuiltinLogging PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) + target_link_libraries(BuiltinLogging fastcdr GTest::gtest ${OPENSSL_LIBRARIES}) + add_gtest(BuiltinLogging SOURCES ${COMMON_SOURCES_LOGGING_PLUGIN_TEST_SOURCE} + ${CMAKE_CURRENT_SOURCE_DIR}/LoggingPluginTests.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/BuiltinLogTopicTests.cpp) endif() diff --git a/test/unittest/statistics/dds/CMakeLists.txt b/test/unittest/statistics/dds/CMakeLists.txt index b53dd58fc28..15748f76911 100644 --- a/test/unittest/statistics/dds/CMakeLists.txt +++ b/test/unittest/statistics/dds/CMakeLists.txt @@ -13,337 +13,335 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if (GTest_FOUND) - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - add_definitions(-DNOMINMAX) - endif() + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) + add_definitions(-DNOMINMAX) + endif() - ## StatisticsDomainParticipantTests - set(STATISTICS_DOMAINPARTICIPANT_TESTS_SOURCE - StatisticsDomainParticipantTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx) + ## StatisticsDomainParticipantTests + set(STATISTICS_DOMAINPARTICIPANT_TESTS_SOURCE + StatisticsDomainParticipantTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx) - add_executable(StatisticsDomainParticipantTests ${STATISTICS_DOMAINPARTICIPANT_TESTS_SOURCE}) - target_compile_definitions(StatisticsDomainParticipantTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNAL_DEBUG> # Internal debug activated. - ) - target_include_directories(StatisticsDomainParticipantTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) - target_link_libraries(StatisticsDomainParticipantTests fastrtps fastcdr GTest::gtest) - add_gtest(StatisticsDomainParticipantTests SOURCES ${STATISTICS_DOMAINPARTICIPANT_TESTS_SOURCE}) + add_executable(StatisticsDomainParticipantTests ${STATISTICS_DOMAINPARTICIPANT_TESTS_SOURCE}) + target_compile_definitions(StatisticsDomainParticipantTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNAL_DEBUG> # Internal debug activated. + ) + target_include_directories(StatisticsDomainParticipantTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) + target_link_libraries(StatisticsDomainParticipantTests fastrtps fastcdr GTest::gtest) + add_gtest(StatisticsDomainParticipantTests SOURCES ${STATISTICS_DOMAINPARTICIPANT_TESTS_SOURCE}) - ## StatisticsQosTests - set(STATISTICS_QOS_TESTS_SOURCE - StatisticsQosTests.cpp) + ## StatisticsQosTests + set(STATISTICS_QOS_TESTS_SOURCE + StatisticsQosTests.cpp) - add_executable(StatisticsQosTests ${STATISTICS_QOS_TESTS_SOURCE}) - target_compile_definitions(StatisticsQosTests PRIVATE FASTRTPS_NO_LIB + add_executable(StatisticsQosTests ${STATISTICS_QOS_TESTS_SOURCE}) + target_compile_definitions(StatisticsQosTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNAL_DEBUG> # Internal debug activated. + ) + target_include_directories(StatisticsQosTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) + target_link_libraries(StatisticsQosTests fastrtps fastcdr GTest::gtest) + add_gtest(StatisticsQosTests SOURCES ${STATISTICS_QOS_TESTS_SOURCE}) + + ## StatisticsDomainParticipantListenerTests + if (FASTDDS_STATISTICS) + set(DOMAINPARTICIPANTSTATISTICSLISTENER_TESTS_SOURCE + DomainParticipantStatisticsListenerTests.cpp) + + add_executable(DomainParticipantStatisticsListenerTests + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp + ${DOMAINPARTICIPANTSTATISTICSLISTENER_TESTS_SOURCE}) + target_compile_definitions(DomainParticipantStatisticsListenerTests PRIVATE FASTRTPS_NO_LIB $<$>,$>:__DEBUG> $<$:__INTERNAL_DEBUG> # Internal debug activated. ) - target_include_directories(StatisticsQosTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp) - target_link_libraries(StatisticsQosTests fastrtps fastcdr GTest::gtest) - add_gtest(StatisticsQosTests SOURCES ${STATISTICS_QOS_TESTS_SOURCE}) + target_include_directories(DomainParticipantStatisticsListenerTests PRIVATE + DomainParticipantStatisticsListenerTests/mock + ${PROJECT_SOURCE_DIR}/include + ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp) + target_link_libraries(DomainParticipantStatisticsListenerTests + fastcdr GTest::gmock ) + add_gtest(DomainParticipantStatisticsListenerTests + SOURCES ${DOMAINPARTICIPANTSTATISTICSLISTENER_TESTS_SOURCE}) + endif() - ## StatisticsDomainParticipantListenerTests - if (FASTDDS_STATISTICS) - set(DOMAINPARTICIPANTSTATISTICSLISTENER_TESTS_SOURCE - DomainParticipantStatisticsListenerTests.cpp) + ## StatisticsDomainParticipantMockTests + if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS) + set(STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE + StatisticsDomainParticipantMockTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/common/RPCHeadersImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/TypeLookupManager.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/TypeLookupReplyListener.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/TypeLookupRequestListener.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypes.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/QosPolicyUtils.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/DomainParticipant.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/DomainParticipantFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/qos/DomainParticipantQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/DataWriter.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/DataWriterImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/PublisherImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/DataWriterQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/PublisherQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/DataReader.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/DataReaderImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/DataReaderQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/Subscriber.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/SubscriberImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/SubscriberQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/Topic.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TypeSupport.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/qos/TopicQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastrtps_deprecated/publisher/PublisherHistory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastrtps_deprecated/subscriber/SubscriberHistory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/BuiltinProtocols.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/data/ParticipantProxyData.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/data/ReaderProxyData.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/data/WriterProxyData.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/database/backup/SharedBackupFunctions.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/database/DiscoveryParticipantsAckStatus.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/database/DiscoveryParticipantInfo.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/database/DiscoverySharedInfo.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/endpoint/EDPClient.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/endpoint/EDPServer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/endpoint/EDPServerListeners.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/endpoint/EDPSimple.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/endpoint/EDPSimpleListeners.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/endpoint/EDPStatic.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/participant/DirectMessageSender.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/participant/PDP.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/participant/PDPClient.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/participant/PDPListener.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/participant/PDPServer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/participant/PDPServerListener.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/participant/PDPSimple.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/participant/timedevent/DSClientEvent.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/participant/timedevent/DServerEvent.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/liveliness/WLP.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/liveliness/WLPListener.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/DataSharing/DataSharingListener.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/DataSharing/DataSharingNotification.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/DataSharing/DataSharingPayloadPool.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowController.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputController.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/CacheChangePool.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/History.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/ReaderHistory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPool.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPoolRegistry.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/WriterHistory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/messages/MessageReceiver.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/messages/RTPSGapBuilder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/messages/RTPSMessageCreator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/messages/RTPSMessageGroup.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/messages/SendBuffersManager.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/NetworkFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/ReceiverResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/participant/RTPSParticipant.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/participant/RTPSParticipantImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/persistence/PersistenceFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/persistence/sqlite3.c + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/persistence/SQLite3PersistenceService.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/reader/RTPSReader.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/reader/StatefulPersistentReader.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/reader/StatefulReader.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/reader/StatelessPersistentReader.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/reader/StatelessReader.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/reader/WriterProxy.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/AsyncInterestTree.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/AsyncWriterThread.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/ResourceEvent.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEvent.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEventImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/RTPSDomain.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/ChannelResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptorBasic.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResourceBasic.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/tcp/TCPControlMessage.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/tcp/RTCPMessageManager.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPTransportInterface.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPv4Transport.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPv6Transport.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPChannelResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPTransportInterface.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPv4Transport.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPv6Transport.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/shared_mem/SharedMemTransportDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/LivelinessManager.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/PersistentWriter.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/ReaderLocator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/ReaderProxy.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/RTPSWriter.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatefulPersistentWriter.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatefulWriter.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatelessPersistentWriter.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatelessWriter.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLEndpointParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipant.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/publisher/qos/DataWriterQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/StatisticsBase.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/writer/StatisticsWriterImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/reader/StatisticsReaderImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/StringMatching.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp + ) - add_executable(DomainParticipantStatisticsListenerTests - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp - ${DOMAINPARTICIPANTSTATISTICSLISTENER_TESTS_SOURCE}) - target_compile_definitions(DomainParticipantStatisticsListenerTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNAL_DEBUG> # Internal debug activated. + # SHM Transport + if(IS_THIRDPARTY_BOOST_OK) + list(APPEND STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/shared_mem/test_SharedMemTransport.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/shared_mem/SharedMemTransport.cpp ) - target_include_directories(DomainParticipantStatisticsListenerTests PRIVATE - DomainParticipantStatisticsListenerTests/mock - ${PROJECT_SOURCE_DIR}/include - ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp) - target_link_libraries(DomainParticipantStatisticsListenerTests - fastcdr GTest::gmock ) - add_gtest(DomainParticipantStatisticsListenerTests - SOURCES ${DOMAINPARTICIPANTSTATISTICSLISTENER_TESTS_SOURCE}) endif() - ## StatisticsDomainParticipantMockTests - if (SQLITE3_SUPPORT AND FASTDDS_STATISTICS) - set(STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE - StatisticsDomainParticipantMockTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/common/RPCHeadersImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/TypeLookupManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/TypeLookupReplyListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/TypeLookupRequestListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/builtin/typelookup/common/TypeLookupTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/QosPolicyUtils.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/DomainParticipant.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/DomainParticipantFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/domain/qos/DomainParticipantQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/DataWriter.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/DataWriterImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/PublisherImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/DataWriterQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/PublisherQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/DataReader.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/DataReaderImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/DataReaderQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/Subscriber.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/SubscriberImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/SubscriberQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/Topic.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TopicImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/TypeSupport.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/topic/qos/TopicQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastrtps_deprecated/publisher/PublisherHistory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastrtps_deprecated/subscriber/SubscriberHistory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/attributes/PropertyPolicy.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/BuiltinProtocols.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/data/ParticipantProxyData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/data/ReaderProxyData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/data/WriterProxyData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/database/backup/SharedBackupFunctions.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/database/DiscoveryDataBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/database/DiscoveryParticipantsAckStatus.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/database/DiscoveryParticipantInfo.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/database/DiscoverySharedInfo.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/endpoint/EDP.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/endpoint/EDPClient.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/endpoint/EDPServer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/endpoint/EDPServerListeners.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/endpoint/EDPSimple.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/endpoint/EDPSimpleListeners.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/endpoint/EDPStatic.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/participant/DirectMessageSender.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/participant/PDP.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/participant/PDPClient.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/participant/PDPListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/participant/PDPServer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/participant/PDPServerListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/participant/PDPSimple.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/participant/timedevent/DSClientEvent.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/discovery/participant/timedevent/DServerEvent.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/liveliness/WLP.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/builtin/liveliness/WLPListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/DataSharing/DataSharingListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/DataSharing/DataSharingNotification.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/DataSharing/DataSharingPayloadPool.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowController.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputController.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/CacheChangePool.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/History.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/ReaderHistory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPool.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/TopicPayloadPoolRegistry.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/history/WriterHistory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/messages/MessageReceiver.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/messages/RTPSGapBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/messages/RTPSMessageCreator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/messages/RTPSMessageGroup.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/messages/SendBuffersManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/NetworkFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/ReceiverResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/participant/RTPSParticipant.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/participant/RTPSParticipantImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/persistence/PersistenceFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/persistence/sqlite3.c - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/persistence/SQLite3PersistenceService.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/reader/RTPSReader.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/reader/StatefulPersistentReader.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/reader/StatefulReader.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/reader/StatelessPersistentReader.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/reader/StatelessReader.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/reader/WriterProxy.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/AsyncInterestTree.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/AsyncWriterThread.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/ResourceEvent.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEvent.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEventImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/RTPSDomain.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/ChannelResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptorBasic.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResourceBasic.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/tcp/TCPControlMessage.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/tcp/RTCPMessageManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPTransportInterface.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPv4Transport.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPv6Transport.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPChannelResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPTransportInterface.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPv4Transport.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPv6Transport.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/shared_mem/SharedMemTransportDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/LivelinessManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/PersistentWriter.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/ReaderLocator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/ReaderProxy.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/RTPSWriter.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatefulPersistentWriter.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatefulWriter.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatelessPersistentWriter.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/writer/StatelessWriter.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLEndpointParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipant.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/domain/DomainParticipantStatisticsListener.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/fastdds/publisher/qos/DataWriterQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/StatisticsBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/writer/StatisticsWriterImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/rtps/reader/StatisticsReaderImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/typesPubSubTypes.cxx - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/StringMatching.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp + # TLS Support + if(TLS_FOUND) + list(APPEND STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResourceSecure.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptorSecure.cpp ) + endif() - # SHM Transport - if(IS_THIRDPARTY_BOOST_OK) - list(APPEND STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/shared_mem/test_SharedMemTransport.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/shared_mem/SharedMemTransport.cpp - ) - endif() - - # TLS Support - if(TLS_FOUND) - list(APPEND STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResourceSecure.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptorSecure.cpp - ) - endif() - - # Security Support - if(SECURITY) - list(APPEND STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/exceptions/Exception.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Token.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/exceptions/SecurityException.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/common/SharedSecretHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/logging/Logging.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/SecurityManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/SecurityPluginFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIDH.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/Permissions.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_KeyExchange.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_KeyFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_Types.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIIdentityHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIHandshakeHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/AccessPermissionsHandle.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/CommonParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/GovernanceParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/PermissionsParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/security/logging/LogTopic.cpp - ) - endif() + # Security Support + if(SECURITY) + list(APPEND STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/exceptions/Exception.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Token.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/exceptions/SecurityException.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/common/SharedSecretHandle.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/logging/Logging.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/SecurityManager.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/security/SecurityPluginFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIDH.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/Permissions.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_KeyExchange.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_KeyFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_Transform.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/cryptography/AESGCMGMAC_Types.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIIdentityHandle.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/authentication/PKIHandshakeHandle.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/AccessPermissionsHandle.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/CommonParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/GovernanceParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/accesscontrol/PermissionsParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/security/logging/LogTopic.cpp + ) + endif() - # External sources - if(TINYXML2_SOURCE_DIR) - list(APPEND STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE - ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp + # External sources + if(TINYXML2_SOURCE_DIR) + list(APPEND STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE + ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp ) - endif() + endif() - include_directories(${TINYXML2_INCLUDE_DIR}) + include_directories(${TINYXML2_INCLUDE_DIR}) - add_executable(StatisticsDomainParticipantMockTests ${STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE}) - target_compile_definitions(StatisticsDomainParticipantMockTests PRIVATE FASTRTPS_NO_LIB - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - SQLITE_WIN32_GETVERSIONEX=0 - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - $<$,$>:_WIN32_WINNT=0x0603> - $<$,$>>:_WIN32_WINNT=0x0601> - $<$,$>:SQLITE_OS_WINRT> - $<$,$>,$>>:ASIO_DISABLE_STD_STRING_VIEW> - $<$:_ENABLE_ATOMIC_ALIGNMENT_FIX> - $<$>:FASTDDS_SHM_TRANSPORT_DISABLED> # Do not compile SHM Transport - $<$:SHM_TRANSPORT_BUILTIN> # Enable SHM as built-in transport - $<$:STDOUTERR_LOG_CONSUMER> # Enable StdoutErrConsumer as default LogConsumer - ) - target_include_directories(StatisticsDomainParticipantMockTests PRIVATE - ${OPENSSL_INCLUDE_DIR} - StatisticsDomainParticipantMockTests/mock/ - ${PROJECT_SOURCE_DIR}/test/mock/dds/Publisher/ - ${PROJECT_SOURCE_DIR}/test/mock/dds/DomainParticipantImpl/ - ${PROJECT_SOURCE_DIR}/include - ${PROJECT_BINARY_DIR}/include - ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/src/cpp - ${THIRDPARTY_BOOST_INCLUDE_DIR}) + add_executable(StatisticsDomainParticipantMockTests ${STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE}) + target_compile_definitions(StatisticsDomainParticipantMockTests PRIVATE FASTRTPS_NO_LIB + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + SQLITE_WIN32_GETVERSIONEX=0 + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + $<$,$>:_WIN32_WINNT=0x0603> + $<$,$>>:_WIN32_WINNT=0x0601> + $<$,$>:SQLITE_OS_WINRT> + $<$,$>,$>>:ASIO_DISABLE_STD_STRING_VIEW> + $<$:_ENABLE_ATOMIC_ALIGNMENT_FIX> + $<$>:FASTDDS_SHM_TRANSPORT_DISABLED> # Do not compile SHM Transport + $<$:SHM_TRANSPORT_BUILTIN> # Enable SHM as built-in transport + $<$:STDOUTERR_LOG_CONSUMER> # Enable StdoutErrConsumer as default LogConsumer + ) + target_include_directories(StatisticsDomainParticipantMockTests PRIVATE + ${OPENSSL_INCLUDE_DIR} + StatisticsDomainParticipantMockTests/mock/ + ${PROJECT_SOURCE_DIR}/test/mock/dds/Publisher/ + ${PROJECT_SOURCE_DIR}/test/mock/dds/DomainParticipantImpl/ + ${PROJECT_SOURCE_DIR}/include + ${PROJECT_BINARY_DIR}/include + ${Asio_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/src/cpp + ${THIRDPARTY_BOOST_INCLUDE_DIR}) + target_link_libraries(StatisticsDomainParticipantMockTests ${PRIVACY} + fastcdr + foonathan_memory + GTest::gmock + ${CMAKE_DL_LIBS} + ${TINYXML2_LIBRARY} + $<$:OpenSSL::SSL$OpenSSL::Crypto> + $<$:iphlpapi$Shlwapi> + ${THIRDPARTY_BOOST_LINK_LIBS} + eProsima_atomic + ) + if(MSVC OR MSVC_IDE) target_link_libraries(StatisticsDomainParticipantMockTests ${PRIVACY} - fastcdr - foonathan_memory - GTest::gmock - ${CMAKE_DL_LIBS} - ${TINYXML2_LIBRARY} - $<$:OpenSSL::SSL$OpenSSL::Crypto> - $<$:iphlpapi$Shlwapi> - ${THIRDPARTY_BOOST_LINK_LIBS} - eProsima_atomic + iphlpapi Shlwapi ) - if(MSVC OR MSVC_IDE) - target_link_libraries(StatisticsDomainParticipantMockTests ${PRIVACY} - iphlpapi Shlwapi - ) - endif() - add_gtest(StatisticsDomainParticipantMockTests SOURCES ${STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE}) endif() + add_gtest(StatisticsDomainParticipantMockTests SOURCES ${STATISTICS_DOMAINPARTICIPANT_MOCK_TESTS_SOURCE}) endif() endif() diff --git a/test/unittest/statistics/rtps/CMakeLists.txt b/test/unittest/statistics/rtps/CMakeLists.txt index 425e2821f44..906b629bbc7 100644 --- a/test/unittest/statistics/rtps/CMakeLists.txt +++ b/test/unittest/statistics/rtps/CMakeLists.txt @@ -13,34 +13,31 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if (GTest_FOUND) - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - endif() - - set(STATISTICS_RTPS_TESTS_SOURCE - RTPSStatisticsTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx - ) + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) + endif() - add_executable(RTPSStatisticsTests ${STATISTICS_RTPS_TESTS_SOURCE}) + set(STATISTICS_RTPS_TESTS_SOURCE + RTPSStatisticsTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/statistics/types/types.cxx + ) - target_compile_definitions(RTPSStatisticsTests PRIVATE FASTRTPS_NO_LIB - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNAL_DEBUG> # Internal debug activated. - ) + add_executable(RTPSStatisticsTests ${STATISTICS_RTPS_TESTS_SOURCE}) - target_include_directories(RTPSStatisticsTests PRIVATE - ${PROJECT_SOURCE_DIR}/include - ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ${Asio_INCLUDE_DIR} - ) + target_compile_definitions(RTPSStatisticsTests PRIVATE FASTRTPS_NO_LIB + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + $<$>,$>:__DEBUG> + $<$:__INTERNAL_DEBUG> # Internal debug activated. + ) - target_link_libraries(RTPSStatisticsTests fastrtps fastcdr GTest::gtest GTest::gmock) - add_gtest(RTPSStatisticsTests SOURCES ${STATISTICS_RTPS_TESTS_SOURCE}) + target_include_directories(RTPSStatisticsTests PRIVATE + ${PROJECT_SOURCE_DIR}/include + ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ${Asio_INCLUDE_DIR} + ) - endif() + target_link_libraries(RTPSStatisticsTests fastrtps fastcdr GTest::gtest GTest::gmock) + add_gtest(RTPSStatisticsTests SOURCES ${STATISTICS_RTPS_TESTS_SOURCE}) endif() diff --git a/test/unittest/transport/CMakeLists.txt b/test/unittest/transport/CMakeLists.txt index 1519272f187..d225c99f2d1 100644 --- a/test/unittest/transport/CMakeLists.txt +++ b/test/unittest/transport/CMakeLists.txt @@ -13,268 +13,240 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - if(WIN32) - add_definitions( - -D_WIN32_WINNT=0x0601 - -D_CRT_SECURE_NO_WARNINGS - ) - endif() + if(WIN32) + add_definitions( + -D_WIN32_WINNT=0x0601 + -D_CRT_SECURE_NO_WARNINGS + ) + endif() - # Copy certs - if(TLS_FOUND) - configure_file(${PROJECT_SOURCE_DIR}/test/certs/maincacert.pem - ${CMAKE_CURRENT_BINARY_DIR}/maincacert.pem COPYONLY) - configure_file(${PROJECT_SOURCE_DIR}/test/certs/mainpubcert.pem - ${CMAKE_CURRENT_BINARY_DIR}/mainpubcert.pem COPYONLY) - configure_file(${PROJECT_SOURCE_DIR}/test/certs/mainpubkey.pem - ${CMAKE_CURRENT_BINARY_DIR}/mainpubkey.pem COPYONLY) - configure_file(${PROJECT_SOURCE_DIR}/test/certs/mainsubcert.pem - ${CMAKE_CURRENT_BINARY_DIR}/mainsubcert.pem COPYONLY) - configure_file(${PROJECT_SOURCE_DIR}/test/certs/mainsubkey.pem - ${CMAKE_CURRENT_BINARY_DIR}/mainsubkey.pem COPYONLY) - configure_file(${PROJECT_SOURCE_DIR}/test/unittest/transport/ca.pem - ${CMAKE_CURRENT_BINARY_DIR}/ca.pem COPYONLY) - configure_file(${PROJECT_SOURCE_DIR}/test/unittest/transport/server.pem - ${CMAKE_CURRENT_BINARY_DIR}/server.pem COPYONLY) - configure_file(${PROJECT_SOURCE_DIR}/test/unittest/transport/dh2048.pem - ${CMAKE_CURRENT_BINARY_DIR}/dh2048.pem COPYONLY) - #configure_file(${PROJECT_SOURCE_DIR}/test/certs/governance_helloworld_all_enable.smime - # ${CMAKE_CURRENT_BINARY_DIR}/governance_helloworld_all_enable.smime COPYONLY) - #configure_file(${PROJECT_SOURCE_DIR}/test/certs/permissions_helloworld.smime - # ${CMAKE_CURRENT_BINARY_DIR}/permissions_helloworld.smime COPYONLY) - endif() + # Copy certs + if(TLS_FOUND) + configure_file(${PROJECT_SOURCE_DIR}/test/certs/maincacert.pem + ${CMAKE_CURRENT_BINARY_DIR}/maincacert.pem COPYONLY) + configure_file(${PROJECT_SOURCE_DIR}/test/certs/mainpubcert.pem + ${CMAKE_CURRENT_BINARY_DIR}/mainpubcert.pem COPYONLY) + configure_file(${PROJECT_SOURCE_DIR}/test/certs/mainpubkey.pem + ${CMAKE_CURRENT_BINARY_DIR}/mainpubkey.pem COPYONLY) + configure_file(${PROJECT_SOURCE_DIR}/test/certs/mainsubcert.pem + ${CMAKE_CURRENT_BINARY_DIR}/mainsubcert.pem COPYONLY) + configure_file(${PROJECT_SOURCE_DIR}/test/certs/mainsubkey.pem + ${CMAKE_CURRENT_BINARY_DIR}/mainsubkey.pem COPYONLY) + configure_file(${PROJECT_SOURCE_DIR}/test/unittest/transport/ca.pem + ${CMAKE_CURRENT_BINARY_DIR}/ca.pem COPYONLY) + configure_file(${PROJECT_SOURCE_DIR}/test/unittest/transport/server.pem + ${CMAKE_CURRENT_BINARY_DIR}/server.pem COPYONLY) + configure_file(${PROJECT_SOURCE_DIR}/test/unittest/transport/dh2048.pem + ${CMAKE_CURRENT_BINARY_DIR}/dh2048.pem COPYONLY) + #configure_file(${PROJECT_SOURCE_DIR}/test/certs/governance_helloworld_all_enable.smime + # ${CMAKE_CURRENT_BINARY_DIR}/governance_helloworld_all_enable.smime COPYONLY) + #configure_file(${PROJECT_SOURCE_DIR}/test/certs/permissions_helloworld.smime + # ${CMAKE_CURRENT_BINARY_DIR}/permissions_helloworld.smime COPYONLY) + endif() - set(UDPV4TESTS_SOURCE - UDPv4Tests.cpp - mock/MockReceiverResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPv4Transport.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPTransportInterface.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/ChannelResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPChannelResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/NetworkFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + set(UDPV4TESTS_SOURCE + UDPv4Tests.cpp + mock/MockReceiverResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPv4Transport.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPTransportInterface.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/ChannelResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPChannelResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/NetworkFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ) - set(UDPV6TESTS_SOURCE - UDPv6Tests.cpp - mock/MockReceiverResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPv6Transport.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPTransportInterface.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/ChannelResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPChannelResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/NetworkFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + set(UDPV6TESTS_SOURCE + UDPv6Tests.cpp + mock/MockReceiverResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPv6Transport.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPTransportInterface.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/ChannelResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPChannelResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/NetworkFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ) - set(TCPV4TESTS_SOURCE - TCPv4Tests.cpp - mock/MockReceiverResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/messages/RTPSMessageCreator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPv4Transport.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPTransportInterface.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/ChannelResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResourceBasic.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptorBasic.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/tcp/RTCPMessageManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/tcp/TCPControlMessage.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/NetworkFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/messages/RTPSMessageCreator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/ResourceEvent.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEvent.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEventImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/System.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + set(TCPV4TESTS_SOURCE + TCPv4Tests.cpp + mock/MockReceiverResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/messages/RTPSMessageCreator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPv4Transport.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPTransportInterface.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/ChannelResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResourceBasic.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptorBasic.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/tcp/RTCPMessageManager.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/tcp/TCPControlMessage.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/NetworkFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/messages/RTPSMessageCreator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/ResourceEvent.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEvent.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEventImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/System.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ) - if(TLS_FOUND) - set(TCPV4TESTS_SOURCE - ${TCPV4TESTS_SOURCE} - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResourceSecure.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptorSecure.cpp + if(TLS_FOUND) + set(TCPV4TESTS_SOURCE + ${TCPV4TESTS_SOURCE} + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResourceSecure.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptorSecure.cpp ) - endif() + endif() - set(TCPV6TESTS_SOURCE - TCPv6Tests.cpp - mock/MockReceiverResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/messages/RTPSMessageCreator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPv6Transport.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPTransportInterface.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/ChannelResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResourceBasic.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptorBasic.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/tcp/RTCPMessageManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/tcp/TCPControlMessage.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/NetworkFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/ResourceEvent.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEvent.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEventImpl.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/System.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + set(TCPV6TESTS_SOURCE + TCPv6Tests.cpp + mock/MockReceiverResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/messages/RTPSMessageCreator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPv6Transport.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPTransportInterface.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/ChannelResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResourceBasic.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptorBasic.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/tcp/RTCPMessageManager.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/tcp/TCPControlMessage.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/NetworkFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/ResourceEvent.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEvent.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/resources/TimedEventImpl.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/TimedConditionVariable.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/System.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ) - if(TLS_FOUND) - set(TCPV6TESTS_SOURCE - ${TCPV6TESTS_SOURCE} - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResourceSecure.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptorSecure.cpp + if(TLS_FOUND) + set(TCPV6TESTS_SOURCE + ${TCPV6TESTS_SOURCE} + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPChannelResourceSecure.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/TCPAcceptorSecure.cpp ) - endif() + endif() - set(TEST_UDPV4TESTS_SOURCE - test_UDPv4Tests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/messages/RTPSMessageCreator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/test_UDPv4Transport.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPv4Transport.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPTransportInterface.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/ChannelResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPChannelResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/NetworkFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + set(TEST_UDPV4TESTS_SOURCE + test_UDPv4Tests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/messages/RTPSMessageCreator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/core/policy/ParameterList.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/test_UDPv4Transport.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPv4Transport.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPTransportInterface.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/ChannelResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/UDPChannelResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/NetworkFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ) - set(SHAREDMEMTESTS_SOURCE - SharedMemTests.cpp - mock/MockReceiverResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/shared_mem/SharedMemTransport.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/shared_mem/SharedMemTransportDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/ChannelResource.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/NetworkFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp + set(SHAREDMEMTESTS_SOURCE + SharedMemTests.cpp + mock/MockReceiverResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/shared_mem/SharedMemTransport.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/shared_mem/SharedMemTransportDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/transport/ChannelResource.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/network/NetworkFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp ) - include_directories(mock/) + include_directories(mock/) + + add_executable(UDPv4Tests ${UDPV4TESTS_SOURCE}) + target_compile_definitions(UDPv4Tests PRIVATE FASTRTPS_NO_LIB + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(UDPv4Tests PRIVATE + ${Asio_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/test/mock/rtps/MessageReceiver + ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReceiverResource + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) + target_link_libraries(UDPv4Tests GTest::gtest ${MOCKS}) + if(MSVC OR MSVC_IDE) + target_link_libraries(UDPv4Tests ${PRIVACY} iphlpapi Shlwapi ) + endif() + add_gtest(UDPv4Tests SOURCES ${UDPV4TESTS_SOURCE}) + set(TRANSPORT_XFAIL_LIST XFAIL_UDP4) - add_executable(UDPv4Tests ${UDPV4TESTS_SOURCE}) - target_compile_definitions(UDPv4Tests PRIVATE FASTRTPS_NO_LIB + option(DISABLE_UDPV6_TESTS "Disable UDPv6 tests because fails in some systems" OFF) + + if(NOT DISABLE_UDPV6_TESTS) + add_executable(UDPv6Tests ${UDPV6TESTS_SOURCE}) + target_compile_definitions(UDPv6Tests PRIVATE FASTRTPS_NO_LIB BOOST_ASIO_STANDALONE ASIO_STANDALONE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) - target_include_directories(UDPv4Tests PRIVATE + target_include_directories(UDPv6Tests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/test/mock/rtps/MessageReceiver ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReceiverResource ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) - target_link_libraries(UDPv4Tests GTest::gtest ${MOCKS}) + target_link_libraries(UDPv6Tests GTest::gtest ${MOCKS}) if(MSVC OR MSVC_IDE) - target_link_libraries(UDPv4Tests ${PRIVACY} iphlpapi Shlwapi ) - endif() - add_gtest(UDPv4Tests SOURCES ${UDPV4TESTS_SOURCE}) - set(TRANSPORT_XFAIL_LIST XFAIL_UDP4) - - option(DISABLE_UDPV6_TESTS "Disable UDPv6 tests because fails in some systems" OFF) - - if(NOT DISABLE_UDPV6_TESTS) - add_executable(UDPv6Tests ${UDPV6TESTS_SOURCE}) - target_compile_definitions(UDPv6Tests PRIVATE FASTRTPS_NO_LIB - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(UDPv6Tests PRIVATE - ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/test/mock/rtps/MessageReceiver - ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReceiverResource - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) - target_link_libraries(UDPv6Tests GTest::gtest ${MOCKS}) - if(MSVC OR MSVC_IDE) - target_link_libraries(UDPv6Tests ${PRIVACY} iphlpapi Shlwapi ) - endif() - add_gtest(UDPv6Tests SOURCES ${UDPV6TESTS_SOURCE}) - set(TRANSPORT_XFAIL_LIST ${TRANSPORT_XFAIL_LIST} XFAIL_UDP6) - - add_executable(TCPv6Tests ${TCPV6TESTS_SOURCE}) - target_compile_definitions(TCPv6Tests PRIVATE FASTRTPS_NO_LIB - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(TCPv6Tests PRIVATE - ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/test/mock/rtps/ParticipantProxyData - ${PROJECT_SOURCE_DIR}/test/mock/dds/QosPolicies - ${PROJECT_SOURCE_DIR}/test/mock/rtps/MessageReceiver - ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReceiverResource - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ) - target_link_libraries(TCPv6Tests GTest::gtest ${MOCKS} - $<$:OpenSSL::SSL$OpenSSL::Crypto>) - if(MSVC OR MSVC_IDE) - target_link_libraries(TCPv6Tests ${PRIVACY} fastcdr iphlpapi Shlwapi) - else() - target_link_libraries(TCPv6Tests ${PRIVACY} fastcdr) - endif() - add_gtest(TCPv6Tests SOURCES ${TCPV6TESTS_SOURCE}) - set(TRANSPORT_XFAIL_LIST ${TRANSPORT_XFAIL_LIST} XFAIL_TCP6) + target_link_libraries(UDPv6Tests ${PRIVACY} iphlpapi Shlwapi ) endif() + add_gtest(UDPv6Tests SOURCES ${UDPV6TESTS_SOURCE}) + set(TRANSPORT_XFAIL_LIST ${TRANSPORT_XFAIL_LIST} XFAIL_UDP6) - add_executable(test_UDPv4Tests ${TEST_UDPV4TESTS_SOURCE}) - target_compile_definitions(test_UDPv4Tests PRIVATE FASTRTPS_NO_LIB + add_executable(TCPv6Tests ${TCPV6TESTS_SOURCE}) + target_compile_definitions(TCPv6Tests PRIVATE FASTRTPS_NO_LIB BOOST_ASIO_STANDALONE ASIO_STANDALONE $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) - target_include_directories(test_UDPv4Tests PRIVATE + target_include_directories(TCPv6Tests PRIVATE ${Asio_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/test/mock/rtps/ParticipantProxyData ${PROJECT_SOURCE_DIR}/test/mock/dds/QosPolicies @@ -283,76 +255,102 @@ if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ) - target_link_libraries(test_UDPv4Tests GTest::gtest ${MOCKS}) + target_link_libraries(TCPv6Tests GTest::gtest ${MOCKS} + $<$:OpenSSL::SSL$OpenSSL::Crypto>) if(MSVC OR MSVC_IDE) - target_link_libraries(test_UDPv4Tests ${PRIVACY} iphlpapi Shlwapi) + target_link_libraries(TCPv6Tests ${PRIVACY} fastcdr iphlpapi Shlwapi) else() - target_link_libraries(test_UDPv4Tests ${PRIVACY}) + target_link_libraries(TCPv6Tests ${PRIVACY} fastcdr) endif() - add_gtest(test_UDPv4Tests SOURCES ${TEST_UDPV4TESTS_SOURCE}) - set(TRANSPORT_XFAIL_LIST ${TRANSPORT_XFAIL_LIST} XFAIL_TEST_UDP4) + add_gtest(TCPv6Tests SOURCES ${TCPV6TESTS_SOURCE}) + set(TRANSPORT_XFAIL_LIST ${TRANSPORT_XFAIL_LIST} XFAIL_TCP6) + endif() + + add_executable(test_UDPv4Tests ${TEST_UDPV4TESTS_SOURCE}) + target_compile_definitions(test_UDPv4Tests PRIVATE FASTRTPS_NO_LIB + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(test_UDPv4Tests PRIVATE + ${Asio_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/test/mock/rtps/ParticipantProxyData + ${PROJECT_SOURCE_DIR}/test/mock/dds/QosPolicies + ${PROJECT_SOURCE_DIR}/test/mock/rtps/MessageReceiver + ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReceiverResource + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) + target_link_libraries(test_UDPv4Tests GTest::gtest ${MOCKS}) + if(MSVC OR MSVC_IDE) + target_link_libraries(test_UDPv4Tests ${PRIVACY} iphlpapi Shlwapi) + else() + target_link_libraries(test_UDPv4Tests ${PRIVACY}) + endif() + add_gtest(test_UDPv4Tests SOURCES ${TEST_UDPV4TESTS_SOURCE}) + set(TRANSPORT_XFAIL_LIST ${TRANSPORT_XFAIL_LIST} XFAIL_TEST_UDP4) + + add_executable(TCPv4Tests ${TCPV4TESTS_SOURCE}) + target_compile_definitions(TCPv4Tests PRIVATE FASTRTPS_NO_LIB + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(TCPv4Tests PRIVATE + ${Asio_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/test/mock/rtps/ParticipantProxyData + ${PROJECT_SOURCE_DIR}/test/mock/dds/QosPolicies + ${PROJECT_SOURCE_DIR}/test/mock/rtps/MessageReceiver + ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReceiverResource + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ${PROJECT_SOURCE_DIR}/src/cpp + ) + target_link_libraries(TCPv4Tests GTest::gtest ${MOCKS} + $<$:OpenSSL::SSL$OpenSSL::Crypto>) + if(MSVC OR MSVC_IDE) + target_link_libraries(TCPv4Tests ${PRIVACY} fastcdr iphlpapi Shlwapi) + else() + target_link_libraries(TCPv4Tests ${PRIVACY} fastcdr) + endif() + add_gtest(TCPv4Tests SOURCES ${TCPV4TESTS_SOURCE}) + set(TRANSPORT_XFAIL_LIST ${TRANSPORT_XFAIL_LIST} XFAIL_TCP4) + + if(IS_THIRDPARTY_BOOST_OK) + add_executable(SharedMemTests ${SHAREDMEMTESTS_SOURCE}) - add_executable(TCPv4Tests ${TCPV4TESTS_SOURCE}) - target_compile_definitions(TCPv4Tests PRIVATE FASTRTPS_NO_LIB + target_compile_definitions(SharedMemTests PRIVATE FASTRTPS_NO_LIB BOOST_ASIO_STANDALONE ASIO_STANDALONE + $<$:_ENABLE_ATOMIC_ALIGNMENT_FIX> $<$>,$>:__DEBUG> $<$:__INTERNALDEBUG> # Internal debug activated. ) - target_include_directories(TCPv4Tests PRIVATE + + target_include_directories(SharedMemTests PRIVATE ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/test/mock/rtps/ParticipantProxyData - ${PROJECT_SOURCE_DIR}/test/mock/dds/QosPolicies ${PROJECT_SOURCE_DIR}/test/mock/rtps/MessageReceiver ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReceiverResource ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp + ${THIRDPARTY_BOOST_INCLUDE_DIR} + ) + target_link_libraries(SharedMemTests GTest::gtest ${MOCKS} + $<$:OpenSSL::SSL$OpenSSL::Crypto> + ${THIRDPARTY_BOOST_LINK_LIBS} + eProsima_atomic ) - target_link_libraries(TCPv4Tests GTest::gtest ${MOCKS} - $<$:OpenSSL::SSL$OpenSSL::Crypto>) if(MSVC OR MSVC_IDE) - target_link_libraries(TCPv4Tests ${PRIVACY} fastcdr iphlpapi Shlwapi) + target_link_libraries(SharedMemTests ${PRIVACY} iphlpapi Shlwapi ) else() - target_link_libraries(TCPv4Tests ${PRIVACY} fastcdr) + target_link_libraries(SharedMemTests ${PRIVACY} ) endif() - add_gtest(TCPv4Tests SOURCES ${TCPV4TESTS_SOURCE}) - set(TRANSPORT_XFAIL_LIST ${TRANSPORT_XFAIL_LIST} XFAIL_TCP4) - - if(IS_THIRDPARTY_BOOST_OK) - add_executable(SharedMemTests ${SHAREDMEMTESTS_SOURCE}) - - target_compile_definitions(SharedMemTests PRIVATE FASTRTPS_NO_LIB - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$:_ENABLE_ATOMIC_ALIGNMENT_FIX> - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - - target_include_directories(SharedMemTests PRIVATE - ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/test/mock/rtps/MessageReceiver - ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReceiverResource - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/src/cpp - ${THIRDPARTY_BOOST_INCLUDE_DIR} - ) - target_link_libraries(SharedMemTests GTest::gtest ${MOCKS} - $<$:OpenSSL::SSL$OpenSSL::Crypto> - ${THIRDPARTY_BOOST_LINK_LIBS} - eProsima_atomic - ) - if(MSVC OR MSVC_IDE) - target_link_libraries(SharedMemTests ${PRIVACY} iphlpapi Shlwapi ) - else() - target_link_libraries(SharedMemTests ${PRIVACY} ) - endif() - add_gtest(SharedMemTests SOURCES ${SHAREDMEMTESTS_SOURCE}) - set(TRANSPORT_XFAIL_LIST ${TRANSPORT_XFAIL_LIST} XFAIL_SHM) - endif() - - foreach(TRANSPORT_XFAIL_TEST ${TRANSPORT_XFAIL_LIST}) - add_xfail_label(${CMAKE_CURRENT_SOURCE_DIR}/${TRANSPORT_XFAIL_TEST}.list) - endforeach() + add_gtest(SharedMemTests SOURCES ${SHAREDMEMTESTS_SOURCE}) + set(TRANSPORT_XFAIL_LIST ${TRANSPORT_XFAIL_LIST} XFAIL_SHM) endif() + + foreach(TRANSPORT_XFAIL_TEST ${TRANSPORT_XFAIL_LIST}) + add_xfail_label(${CMAKE_CURRENT_SOURCE_DIR}/${TRANSPORT_XFAIL_TEST}.list) + endforeach() endif() diff --git a/test/unittest/utils/CMakeLists.txt b/test/unittest/utils/CMakeLists.txt index 2b5790d6988..245db363d2f 100644 --- a/test/unittest/utils/CMakeLists.txt +++ b/test/unittest/utils/CMakeLists.txt @@ -13,117 +13,113 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - if(WIN32) - add_definitions(-D_WIN32_WINNT=0x0601) - endif() - - - set(STRINGMATCHINGTESTS_SOURCE - StringMatchingTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/StringMatching.cpp) - - set(FIXEDSIZESTRINGTESTS_SOURCE - FixedSizeStringTests.cpp) - - set(BITMAPRANGETESTS_SOURCE - BitmapRangeTests.cpp) - - set(RESOURCELIMITEDVECTORTESTS_SOURCE - ResourceLimitedVectorTests.cpp) - - set(LOCATORTESTS_SOURCE - LocatorTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp) - - set(FIXEDSIZEQUEUETESTS_SOURCE - FixedSizeQueueTests.cpp) - - set(SYSTEMINFOTESTS_SOURCE - SystemInfoTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp) - - include_directories(mock/) - - add_executable(StringMatchingTests ${STRINGMATCHINGTESTS_SOURCE}) - target_compile_definitions(StringMatchingTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(StringMatchingTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(StringMatchingTests GTest::gtest ${MOCKS}) - if(MSVC OR MSVC_IDE) - target_link_libraries(StringMatchingTests ${PRIVACY} iphlpapi Shlwapi - ) - endif() - add_gtest(StringMatchingTests SOURCES ${STRINGMATCHINGTESTS_SOURCE}) - - - add_executable(FixedSizeStringTests ${FIXEDSIZESTRINGTESTS_SOURCE}) - target_compile_definitions(FixedSizeStringTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(FixedSizeStringTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(FixedSizeStringTests GTest::gtest ${MOCKS}) - add_gtest(FixedSizeStringTests SOURCES ${FIXEDSIZESTRINGTESTS_SOURCE}) - - - add_executable(BitmapRangeTests ${BITMAPRANGETESTS_SOURCE}) - target_compile_definitions(BitmapRangeTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(BitmapRangeTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(BitmapRangeTests GTest::gtest ${MOCKS}) - add_gtest(BitmapRangeTests SOURCES ${BITMAPRANGETESTS_SOURCE}) - + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0601) + endif() - add_executable(ResourceLimitedVectorTests ${RESOURCELIMITEDVECTORTESTS_SOURCE}) - target_compile_definitions(ResourceLimitedVectorTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. + set(STRINGMATCHINGTESTS_SOURCE + StringMatchingTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/StringMatching.cpp) + + set(FIXEDSIZESTRINGTESTS_SOURCE + FixedSizeStringTests.cpp) + + set(BITMAPRANGETESTS_SOURCE + BitmapRangeTests.cpp) + + set(RESOURCELIMITEDVECTORTESTS_SOURCE + ResourceLimitedVectorTests.cpp) + + set(LOCATORTESTS_SOURCE + LocatorTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp) + + set(FIXEDSIZEQUEUETESTS_SOURCE + FixedSizeQueueTests.cpp) + + set(SYSTEMINFOTESTS_SOURCE + SystemInfoTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/SystemInfo.cpp) + + include_directories(mock/) + + add_executable(StringMatchingTests ${STRINGMATCHINGTESTS_SOURCE}) + target_compile_definitions(StringMatchingTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(StringMatchingTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(StringMatchingTests GTest::gtest ${MOCKS}) + if(MSVC OR MSVC_IDE) + target_link_libraries(StringMatchingTests ${PRIVACY} iphlpapi Shlwapi ) - target_include_directories(ResourceLimitedVectorTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(ResourceLimitedVectorTests GTest::gtest ${MOCKS}) - add_gtest(ResourceLimitedVectorTests SOURCES ${RESOURCELIMITEDVECTORTESTS_SOURCE}) - - add_executable(LocatorTests ${LOCATORTESTS_SOURCE}) - target_compile_definitions(LocatorTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(LocatorTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) - target_link_libraries(LocatorTests GTest::gtest ${MOCKS}) - add_gtest(LocatorTests SOURCES ${LOCATORTESTS_SOURCE}) - - - add_executable(FixedSizeQueueTests ${FIXEDSIZEQUEUETESTS_SOURCE}) - target_compile_definitions(FixedSizeQueueTests PRIVATE FASTRTPS_NO_LIB) - target_include_directories(FixedSizeQueueTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ${PROJECT_BINARY_DIR}/include) - target_link_libraries(FixedSizeQueueTests GTest::gtest ${MOCKS}) - add_gtest(FixedSizeQueueTests SOURCES ${FIXEDSIZEQUEUETESTS_SOURCE}) - - add_executable(SystemInfoTests ${SYSTEMINFOTESTS_SOURCE}) - target_compile_definitions(SystemInfoTests PRIVATE FASTRTPS_NO_LIB) - target_include_directories(SystemInfoTests PRIVATE - ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ${PROJECT_BINARY_DIR}/include) - target_link_libraries(SystemInfoTests GTest::gtest) - add_gtest(SystemInfoTests SOURCES ${SYSTEMINFOTESTS_SOURCE}) - endif() + add_gtest(StringMatchingTests SOURCES ${STRINGMATCHINGTESTS_SOURCE}) + + + add_executable(FixedSizeStringTests ${FIXEDSIZESTRINGTESTS_SOURCE}) + target_compile_definitions(FixedSizeStringTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(FixedSizeStringTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(FixedSizeStringTests GTest::gtest ${MOCKS}) + add_gtest(FixedSizeStringTests SOURCES ${FIXEDSIZESTRINGTESTS_SOURCE}) + + + add_executable(BitmapRangeTests ${BITMAPRANGETESTS_SOURCE}) + target_compile_definitions(BitmapRangeTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(BitmapRangeTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(BitmapRangeTests GTest::gtest ${MOCKS}) + add_gtest(BitmapRangeTests SOURCES ${BITMAPRANGETESTS_SOURCE}) + + + add_executable(ResourceLimitedVectorTests ${RESOURCELIMITEDVECTORTESTS_SOURCE}) + target_compile_definitions(ResourceLimitedVectorTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(ResourceLimitedVectorTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(ResourceLimitedVectorTests GTest::gtest ${MOCKS}) + add_gtest(ResourceLimitedVectorTests SOURCES ${RESOURCELIMITEDVECTORTESTS_SOURCE}) + + add_executable(LocatorTests ${LOCATORTESTS_SOURCE}) + target_compile_definitions(LocatorTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(LocatorTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(LocatorTests GTest::gtest ${MOCKS}) + add_gtest(LocatorTests SOURCES ${LOCATORTESTS_SOURCE}) + + + add_executable(FixedSizeQueueTests ${FIXEDSIZEQUEUETESTS_SOURCE}) + target_compile_definitions(FixedSizeQueueTests PRIVATE FASTRTPS_NO_LIB) + target_include_directories(FixedSizeQueueTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ${PROJECT_BINARY_DIR}/include) + target_link_libraries(FixedSizeQueueTests GTest::gtest ${MOCKS}) + add_gtest(FixedSizeQueueTests SOURCES ${FIXEDSIZEQUEUETESTS_SOURCE}) + + add_executable(SystemInfoTests ${SYSTEMINFOTESTS_SOURCE}) + target_compile_definitions(SystemInfoTests PRIVATE FASTRTPS_NO_LIB) + target_include_directories(SystemInfoTests PRIVATE + ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/src/cpp ${PROJECT_BINARY_DIR}/include) + target_link_libraries(SystemInfoTests GTest::gtest) + add_gtest(SystemInfoTests SOURCES ${SYSTEMINFOTESTS_SOURCE}) endif() diff --git a/test/unittest/xmlparser/CMakeLists.txt b/test/unittest/xmlparser/CMakeLists.txt index 41070ce2e33..8eaf82e1cc2 100644 --- a/test/unittest/xmlparser/CMakeLists.txt +++ b/test/unittest/xmlparser/CMakeLists.txt @@ -13,322 +13,318 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - if(WIN32) - add_definitions( - -D_WIN32_WINNT=0x0601 - -D_CRT_SECURE_NO_WARNINGS - ) - endif() - - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_xml_duration.xml - ${CMAKE_CURRENT_BINARY_DIR}/test_xml_duration.xml - COPYONLY) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_xml_root_library_settings.xml - ${CMAKE_CURRENT_BINARY_DIR}/test_xml_root_library_settings.xml - COPYONLY) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_xml_profiles.xml - ${CMAKE_CURRENT_BINARY_DIR}/test_xml_profiles.xml - COPYONLY) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_xml_security_profiles.xml - ${CMAKE_CURRENT_BINARY_DIR}/test_xml_security_profiles.xml - COPYONLY) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_xml_profiles_rooted.xml - ${CMAKE_CURRENT_BINARY_DIR}/test_xml_profiles_rooted.xml - COPYONLY) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/log_stdouterr.xml - ${CMAKE_CURRENT_BINARY_DIR}/log_stdouterr.xml - COPYONLY) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/log_stdouterr_wrong_property_name.xml - ${CMAKE_CURRENT_BINARY_DIR}/log_stdouterr_wrong_property_name.xml - COPYONLY) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/log_stdouterr_wrong_property_value.xml - ${CMAKE_CURRENT_BINARY_DIR}/log_stdouterr_wrong_property_value.xml - COPYONLY) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/log_stdouterr_two_thresholds.xml - ${CMAKE_CURRENT_BINARY_DIR}/log_stdouterr_two_thresholds.xml - COPYONLY) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/log_def_file.xml - ${CMAKE_CURRENT_BINARY_DIR}/log_def_file.xml - COPYONLY) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/log_inactive.xml - ${CMAKE_CURRENT_BINARY_DIR}/log_inactive.xml - COPYONLY) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/log_node_file_append.xml - ${CMAKE_CURRENT_BINARY_DIR}/log_node_file_append.xml - COPYONLY) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tls_config.xml - ${CMAKE_CURRENT_BINARY_DIR}/tls_config.xml - COPYONLY) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/UDP_transport_descriptors_config.xml - ${CMAKE_CURRENT_BINARY_DIR}/UDP_transport_descriptors_config.xml - COPYONLY) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/SHM_transport_descriptors_config.xml - ${CMAKE_CURRENT_BINARY_DIR}/SHM_transport_descriptors_config.xml - COPYONLY) - - ################################### XMLProfileParserTests #################################################### - set(XMLPROFILEPARSER_SOURCE - XMLProfileParserTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + if(WIN32) + add_definitions( + -D_WIN32_WINNT=0x0601 + -D_CRT_SECURE_NO_WARNINGS ) + endif() - # External sources - if(TINYXML2_SOURCE_DIR) - list(APPEND XMLPROFILEPARSER_SOURCE - ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp - ) - endif() + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_xml_duration.xml + ${CMAKE_CURRENT_BINARY_DIR}/test_xml_duration.xml + COPYONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_xml_root_library_settings.xml + ${CMAKE_CURRENT_BINARY_DIR}/test_xml_root_library_settings.xml + COPYONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_xml_profiles.xml + ${CMAKE_CURRENT_BINARY_DIR}/test_xml_profiles.xml + COPYONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_xml_security_profiles.xml + ${CMAKE_CURRENT_BINARY_DIR}/test_xml_security_profiles.xml + COPYONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_xml_profiles_rooted.xml + ${CMAKE_CURRENT_BINARY_DIR}/test_xml_profiles_rooted.xml + COPYONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/log_stdouterr.xml + ${CMAKE_CURRENT_BINARY_DIR}/log_stdouterr.xml + COPYONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/log_stdouterr_wrong_property_name.xml + ${CMAKE_CURRENT_BINARY_DIR}/log_stdouterr_wrong_property_name.xml + COPYONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/log_stdouterr_wrong_property_value.xml + ${CMAKE_CURRENT_BINARY_DIR}/log_stdouterr_wrong_property_value.xml + COPYONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/log_stdouterr_two_thresholds.xml + ${CMAKE_CURRENT_BINARY_DIR}/log_stdouterr_two_thresholds.xml + COPYONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/log_def_file.xml + ${CMAKE_CURRENT_BINARY_DIR}/log_def_file.xml + COPYONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/log_inactive.xml + ${CMAKE_CURRENT_BINARY_DIR}/log_inactive.xml + COPYONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/log_node_file_append.xml + ${CMAKE_CURRENT_BINARY_DIR}/log_node_file_append.xml + COPYONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tls_config.xml + ${CMAKE_CURRENT_BINARY_DIR}/tls_config.xml + COPYONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/UDP_transport_descriptors_config.xml + ${CMAKE_CURRENT_BINARY_DIR}/UDP_transport_descriptors_config.xml + COPYONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/SHM_transport_descriptors_config.xml + ${CMAKE_CURRENT_BINARY_DIR}/SHM_transport_descriptors_config.xml + COPYONLY) - include_directories(${TINYXML2_INCLUDE_DIR}) + ################################### XMLProfileParserTests #################################################### + set(XMLPROFILEPARSER_SOURCE + XMLProfileParserTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ) - add_executable(XMLProfileParserTests ${XMLPROFILEPARSER_SOURCE}) - target_compile_definitions(XMLProfileParserTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. + # External sources + if(TINYXML2_SOURCE_DIR) + list(APPEND XMLPROFILEPARSER_SOURCE + ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp ) - target_include_directories(XMLProfileParserTests PRIVATE - ${PROJECT_SOURCE_DIR}/test/mock/rtps/Log - ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPTransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv4TransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv6TransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPTransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPv4TransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPv6TransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/SharedMemTransportDescriptor - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + endif() - target_link_libraries(XMLProfileParserTests GTest::gmock - $<$:iphlpapi$Shlwapi> - $<$:ws2_32> - ${TINYXML2_LIBRARY} - fastcdr - ) - add_gtest(XMLProfileParserTests SOURCES XMLProfileParserTests.cpp) - ################################### XMLProfileParserTests #################################################### + include_directories(${TINYXML2_INCLUDE_DIR}) + add_executable(XMLProfileParserTests ${XMLPROFILEPARSER_SOURCE}) + target_compile_definitions(XMLProfileParserTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(XMLProfileParserTests PRIVATE + ${PROJECT_SOURCE_DIR}/test/mock/rtps/Log + ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPTransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv4TransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv6TransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPTransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPv4TransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPv6TransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/SharedMemTransportDescriptor + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) + target_link_libraries(XMLProfileParserTests GTest::gmock + $<$:iphlpapi$Shlwapi> + $<$:ws2_32> + ${TINYXML2_LIBRARY} + fastcdr + ) + add_gtest(XMLProfileParserTests SOURCES XMLProfileParserTests.cpp) + ################################### XMLProfileParserTests #################################################### - ###################################### XMLParserTests ######################################################## - set(XMLPARSER_SOURCE - XMLParserTests.cpp - XMLElementParserTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ) - # External sources - if(TINYXML2_SOURCE_DIR) - list(APPEND XMLPARSER_SOURCE - ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp - ) - endif() + ###################################### XMLParserTests ######################################################## + set(XMLPARSER_SOURCE + XMLParserTests.cpp + XMLElementParserTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLProfileManager.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLDynamicParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLElementParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/ThroughputControllerDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPFinder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp - include_directories(${TINYXML2_INCLUDE_DIR}) + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ) - add_executable(XMLParserTests ${XMLPARSER_SOURCE}) - target_compile_definitions(XMLParserTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(XMLParserTests PRIVATE - ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPTransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv4TransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv6TransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPTransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPv4TransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPv6TransportDescriptor - ${PROJECT_SOURCE_DIR}/test/mock/rtps/SharedMemTransportDescriptor - ${PROJECT_SOURCE_DIR}/include - ${PROJECT_BINARY_DIR}/include + # External sources + if(TINYXML2_SOURCE_DIR) + list(APPEND XMLPARSER_SOURCE + ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp ) + endif() + + include_directories(${TINYXML2_INCLUDE_DIR}) - target_link_libraries(XMLParserTests GTest::gtest - $<$:iphlpapi$Shlwapi> - $<$:ws2_32> - ${TINYXML2_LIBRARY} - fastcdr + add_executable(XMLParserTests ${XMLPARSER_SOURCE}) + target_compile_definitions(XMLParserTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. ) - add_gtest(XMLParserTests SOURCES XMLParserTests.cpp XMLElementParserTests.cpp) - ###################################### XMLParserTests ######################################################## + target_include_directories(XMLParserTests PRIVATE + ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPTransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv4TransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/TCPv6TransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPTransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPv4TransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/UDPv6TransportDescriptor + ${PROJECT_SOURCE_DIR}/test/mock/rtps/SharedMemTransportDescriptor + ${PROJECT_SOURCE_DIR}/include + ${PROJECT_BINARY_DIR}/include + ) + + target_link_libraries(XMLParserTests GTest::gtest + $<$:iphlpapi$Shlwapi> + $<$:ws2_32> + ${TINYXML2_LIBRARY} + fastcdr + ) + add_gtest(XMLParserTests SOURCES XMLParserTests.cpp XMLElementParserTests.cpp) + ###################################### XMLParserTests ######################################################## - ####################################### XMLTreeTests ######################################################### - set(XMLTREE_SOURCE - XMLTreeTests.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp + ####################################### XMLTreeTests ######################################################### + set(XMLTREE_SOURCE + XMLTreeTests.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp ) - include_directories(${TINYXML2_INCLUDE_DIR}) + include_directories(${TINYXML2_INCLUDE_DIR}) - add_executable(XMLTreeTests ${XMLTREE_SOURCE}) - target_compile_definitions(XMLTreeTests PRIVATE FASTRTPS_NO_LIB - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(XMLTreeTests PRIVATE - ${PROJECT_SOURCE_DIR}/include - ${PROJECT_BINARY_DIR}/include - ) + add_executable(XMLTreeTests ${XMLTREE_SOURCE}) + target_compile_definitions(XMLTreeTests PRIVATE FASTRTPS_NO_LIB + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(XMLTreeTests PRIVATE + ${PROJECT_SOURCE_DIR}/include + ${PROJECT_BINARY_DIR}/include + ) - target_link_libraries(XMLTreeTests GTest::gtest - $<$:iphlpapi$Shlwapi> - $<$:ws2_32> + target_link_libraries(XMLTreeTests GTest::gtest + $<$:iphlpapi$Shlwapi> + $<$:ws2_32> ) - add_gtest(XMLTreeTests SOURCES XMLTreeTests.cpp) - ####################################### XMLTreeTests ######################################################### + add_gtest(XMLTreeTests SOURCES XMLTreeTests.cpp) + ####################################### XMLTreeTests ######################################################### - ################################### XMLENDPOINTPARSERTESTS ################################################### - set(XMLENDPOINTPARSERTESTS_SOURCE - XMLEndpointParserTests.cpp + ################################### XMLENDPOINTPARSERTESTS ################################################### + set(XMLENDPOINTPARSERTESTS_SOURCE + XMLEndpointParserTests.cpp - # parser - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLEndpointParser.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp + # parser + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLEndpointParser.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/xmlparser/XMLParserCommon.cpp - # log - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp + # log + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/FileConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/flowcontrol/FlowControllerConsts.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/publisher/qos/WriterQos.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/subscriber/qos/ReaderQos.cpp - # locators - ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + # locators + ${PROJECT_SOURCE_DIR}/src/cpp/utils/IPLocator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp ) - # External sources - if(TINYXML2_SOURCE_DIR) - list(APPEND XMLENDPOINTPARSERTESTS_SOURCE - ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp - ) - endif() - - include_directories(${TINYXML2_INCLUDE_DIR}) - - add_executable(XMLEndpointParserTests ${XMLENDPOINTPARSERTESTS_SOURCE}) - target_compile_definitions(XMLEndpointParserTests PRIVATE FASTRTPS_NO_LIB) - target_include_directories(XMLEndpointParserTests PRIVATE - ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderProxyData - ${PROJECT_SOURCE_DIR}/test/mock/rtps/WriterProxyData - ${PROJECT_SOURCE_DIR}/include - ${PROJECT_BINARY_DIR}/include + # External sources + if(TINYXML2_SOURCE_DIR) + list(APPEND XMLENDPOINTPARSERTESTS_SOURCE + ${TINYXML2_SOURCE_DIR}/tinyxml2.cpp ) + endif() - target_link_libraries(XMLEndpointParserTests GTest::gtest - $<$:iphlpapi$Shlwapi> - $<$:ws2_32> - ${TINYXML2_LIBRARY} - fastcdr + include_directories(${TINYXML2_INCLUDE_DIR}) + + add_executable(XMLEndpointParserTests ${XMLENDPOINTPARSERTESTS_SOURCE}) + target_compile_definitions(XMLEndpointParserTests PRIVATE FASTRTPS_NO_LIB) + target_include_directories(XMLEndpointParserTests PRIVATE + ${PROJECT_SOURCE_DIR}/test/mock/rtps/ReaderProxyData + ${PROJECT_SOURCE_DIR}/test/mock/rtps/WriterProxyData + ${PROJECT_SOURCE_DIR}/include + ${PROJECT_BINARY_DIR}/include ) - add_gtest(XMLEndpointParserTests SOURCES XMLEndpointParserTests.cpp) - ################################### XMLENDPOINTPARSERTESTS ################################################### - endif() + target_link_libraries(XMLEndpointParserTests GTest::gtest + $<$:iphlpapi$Shlwapi> + $<$:ws2_32> + ${TINYXML2_LIBRARY} + fastcdr + ) + add_gtest(XMLEndpointParserTests SOURCES XMLEndpointParserTests.cpp) endif() diff --git a/test/unittest/xtypes/CMakeLists.txt b/test/unittest/xtypes/CMakeLists.txt index 11dd4cb41ef..145e20591ba 100644 --- a/test/unittest/xtypes/CMakeLists.txt +++ b/test/unittest/xtypes/CMakeLists.txt @@ -13,75 +13,72 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER)) - if(GTest_FOUND) - if(WIN32) - add_definitions( - -D_WIN32_WINNT=0x0601 - -D_CRT_SECURE_NO_WARNINGS - ) - endif() + if(WIN32) + add_definitions( + -D_WIN32_WINNT=0x0601 + -D_CRT_SECURE_NO_WARNINGS + ) + endif() - set(XTYPES_SOURCE - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp - ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp + set(XTYPES_SOURCE + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicData.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicPubSubType.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypePtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicDataPtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilder.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderPtr.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeBuilderFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/DynamicTypeMember.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/MemberDescriptor.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/AnnotationParameterValue.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifier.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeIdentifierTypes.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObject.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectFactory.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeObjectHashId.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypeNamesGenerator.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/TypesBase.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/dynamic-types/BuiltinAnnotationsTypeObject.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/md5.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/utils/string_convert.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/rtps/common/Time_t.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/Log.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/OStreamConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutConsumer.cpp + ${PROJECT_SOURCE_DIR}/src/cpp/fastdds/log/StdoutErrConsumer.cpp ) - set(XTYPES_TEST_SOURCE - XTypesTests.cpp - idl/TypesTypeObject.cxx - idl/Types.cxx - idl/WideEnumTypeObject.cxx - idl/WideEnum.cxx - ${XTYPES_SOURCE} + set(XTYPES_TEST_SOURCE + XTypesTests.cpp + idl/TypesTypeObject.cxx + idl/Types.cxx + idl/WideEnumTypeObject.cxx + idl/WideEnum.cxx + ${XTYPES_SOURCE} ) - include_directories(mock/) - - add_executable(XTypesTests ${XTYPES_TEST_SOURCE}) - target_compile_definitions(XTypesTests PRIVATE FASTRTPS_NO_LIB - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. - ) - target_include_directories(XTypesTests PRIVATE - ${Asio_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include - ) - target_link_libraries(XTypesTests GTest::gtest ${MOCKS}) - if(MSVC OR MSVC_IDE) - target_link_libraries(XTypesTests ${PRIVACY} fastcdr iphlpapi Shlwapi ws2_32) - else() - target_link_libraries(XTypesTests ${PRIVACY} fastcdr) - endif() - add_gtest(XTypesTests SOURCES ${XTYPES_TEST_SOURCE}) + include_directories(mock/) + add_executable(XTypesTests ${XTYPES_TEST_SOURCE}) + target_compile_definitions(XTypesTests PRIVATE FASTRTPS_NO_LIB + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(XTypesTests PRIVATE + ${Asio_INCLUDE_DIR} + ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include + ) + target_link_libraries(XTypesTests GTest::gtest ${MOCKS}) + if(MSVC OR MSVC_IDE) + target_link_libraries(XTypesTests ${PRIVACY} fastcdr iphlpapi Shlwapi ws2_32) + else() + target_link_libraries(XTypesTests ${PRIVACY} fastcdr) endif() + add_gtest(XTypesTests SOURCES ${XTYPES_TEST_SOURCE}) endif() diff --git a/test/xtypes/CMakeLists.txt b/test/xtypes/CMakeLists.txt index 9f70a821146..9f2e5016819 100644 --- a/test/xtypes/CMakeLists.txt +++ b/test/xtypes/CMakeLists.txt @@ -76,41 +76,34 @@ macro(add_xtypes_gtest test) endmacro() if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER) AND fastcdr_FOUND) - if(GTest_FOUND) - if(WIN32) - add_definitions( - -D_WIN32_WINNT=0x0601 - -D_CRT_SECURE_NO_WARNINGS - ) - endif() - - ############################################################################### - # Unit tests - ############################################################################### - set(XTYPES_TESTS_SOURCE XTypesTests.cpp - idl/Types.cxx - idl/TypesPubSubTypes.cxx - idl/TypesTypeObject.cxx - TestPublisher.cpp - TestSubscriber.cpp - ) - - add_executable(XTypesBlackBoxTests ${XTYPES_TESTS_SOURCE}) - target_compile_definitions(XTypesBlackBoxTests PRIVATE - EPROSIMA_SHAPES_DLL_EXPORT - BUILD_SHARED_LIBS - BOOST_ASIO_STANDALONE - ASIO_STANDALONE - $<$>,$>:__DEBUG> - $<$:__INTERNALDEBUG> # Internal debug activated. + if(WIN32) + add_definitions( + -D_WIN32_WINNT=0x0601 + -D_CRT_SECURE_NO_WARNINGS ) - target_include_directories(XTypesBlackBoxTests PRIVATE ${Asio_INCLUDE_DIR}) - target_link_libraries(XTypesBlackBoxTests fastrtps fastcdr GTest::gtest) - add_xtypes_gtest(XTypesBlackBoxTests SOURCES ${XTYPES_TESTS_SOURCE}) endif() -endif() -# DYNAMIC -> DYNAMIC TRANSFORM -#file(GLOB TYPES_LIB_SOURCE "typeslib.cpp") -#add_library(Types SHARED ${TYPES_LIB_SOURCE}) -#target_link_libraries(Types fastrtps fastcdr ${CMAKE_DL_LIBS}) + ############################################################################### + # Unit tests + ############################################################################### + set(XTYPES_TESTS_SOURCE XTypesTests.cpp + idl/Types.cxx + idl/TypesPubSubTypes.cxx + idl/TypesTypeObject.cxx + TestPublisher.cpp + TestSubscriber.cpp + ) + + add_executable(XTypesBlackBoxTests ${XTYPES_TESTS_SOURCE}) + target_compile_definitions(XTypesBlackBoxTests PRIVATE + EPROSIMA_SHAPES_DLL_EXPORT + BUILD_SHARED_LIBS + BOOST_ASIO_STANDALONE + ASIO_STANDALONE + $<$>,$>:__DEBUG> + $<$:__INTERNALDEBUG> # Internal debug activated. + ) + target_include_directories(XTypesBlackBoxTests PRIVATE ${Asio_INCLUDE_DIR}) + target_link_libraries(XTypesBlackBoxTests fastrtps fastcdr GTest::gtest) + add_xtypes_gtest(XTypesBlackBoxTests SOURCES ${XTYPES_TESTS_SOURCE}) +endif()