Skip to content

Commit

Permalink
Use FASTRTPS_NO_LIB on unittest root folder (#3856)
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
(cherry picked from commit e00b8e3)

# Conflicts:
#	test/unittest/dds/subscriber/CMakeLists.txt
#	test/unittest/logging/log_macros/CMakeLists.txt
#	test/unittest/rtps/common/CMakeLists.txt
#	test/unittest/rtps/network/CMakeLists.txt
#	test/unittest/rtps/reader/CMakeLists.txt
#	test/unittest/security/accesscontrol/CMakeLists.txt
#	test/unittest/statistics/dds/CMakeLists.txt
  • Loading branch information
MiguelCompany authored and mergify[bot] committed Sep 21, 2023
1 parent ce414c8 commit 174a8cd
Show file tree
Hide file tree
Showing 35 changed files with 399 additions and 75 deletions.
2 changes: 2 additions & 0 deletions test/unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

add_compile_definitions(FASTRTPS_NO_LIB)

add_subdirectory(rtps/common)
add_subdirectory(rtps/DataSharing)
add_subdirectory(rtps/builtin)
Expand Down
2 changes: 1 addition & 1 deletion test/unittest/dds/collections/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ set(LOANABLE_SEQUENCE_TESTS_SOURCE
LoanableSequenceTests.cpp)

add_executable(LoanableSequenceTests ${LOANABLE_SEQUENCE_TESTS_SOURCE})
target_compile_definitions(LoanableSequenceTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(LoanableSequenceTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
Expand Down
8 changes: 4 additions & 4 deletions test/unittest/dds/core/condition/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ set(CONDITION_TESTS_SOURCE
ConditionTests.cpp)

add_executable(ConditionTests ${CONDITION_TESTS_SOURCE})
target_compile_definitions(ConditionTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(ConditionTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
Expand All @@ -56,7 +56,7 @@ set(CONDITION_NOTIFIER_TESTS_SOURCE
ConditionNotifierTests.cpp)

add_executable(ConditionNotifierTests ${CONDITION_NOTIFIER_TESTS_SOURCE})
target_compile_definitions(ConditionNotifierTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(ConditionNotifierTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
Expand All @@ -80,7 +80,7 @@ set(STATUS_CONDITION_IMPL_TESTS_SOURCE
StatusConditionImplTests.cpp)

add_executable(StatusConditionImplTests ${STATUS_CONDITION_IMPL_TESTS_SOURCE})
target_compile_definitions(StatusConditionImplTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(StatusConditionImplTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
Expand All @@ -103,7 +103,7 @@ set(WAITSET_IMPL_TESTS_SOURCE
WaitSetImplTests.cpp)

add_executable(WaitSetImplTests ${WAITSET_IMPL_TESTS_SOURCE})
target_compile_definitions(WaitSetImplTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(WaitSetImplTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
Expand Down
2 changes: 1 addition & 1 deletion test/unittest/dds/core/entity/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ set(ENTITY_TESTS_SOURCE
EntityTests.cpp)

add_executable(EntityTests ${ENTITY_TESTS_SOURCE})
target_compile_definitions(EntityTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(EntityTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
Expand Down
2 changes: 1 addition & 1 deletion test/unittest/dds/participant/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if(WIN32)
endif()

add_executable(ParticipantTests ${PARTICIPANTTESTS_SOURCE})
target_compile_definitions(ParticipantTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(ParticipantTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
Expand Down
4 changes: 2 additions & 2 deletions test/unittest/dds/publisher/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ if(WIN32)
endif()

add_executable(PublisherTests ${PUBLISHERTESTS_SOURCE})
target_compile_definitions(PublisherTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(PublisherTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
Expand All @@ -300,7 +300,7 @@ target_link_libraries(PublisherTests fastrtps fastcdr foonathan_memory
add_gtest(PublisherTests SOURCES ${PUBLISHERTESTS_SOURCE})

add_executable(DataWriterTests ${DATAWRITERTESTS_SOURCE})
target_compile_definitions(DataWriterTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(DataWriterTests PRIVATE
BOOST_ASIO_STANDALONE
ASIO_STANDALONE
ASIO_DISABLE_VISIBILITY
Expand Down
2 changes: 1 addition & 1 deletion test/unittest/dds/status/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ if(WIN32)
endif()

add_executable(ListenerTests ${LISTENERTESTS_SOURCE})
target_compile_definitions(ListenerTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(ListenerTests PRIVATE
BOOST_ASIO_STANDALONE
ASIO_STANDALONE
ASIO_DISABLE_VISIBILITY
Expand Down
54 changes: 53 additions & 1 deletion test/unittest/dds/subscriber/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if(WIN32)
endif()

add_executable(SubscriberTests ${SUBSCRIBERTESTS_SOURCE})
target_compile_definitions(SubscriberTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(SubscriberTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
Expand All @@ -38,7 +38,14 @@ target_link_libraries(SubscriberTests fastrtps fastcdr foonathan_memory
add_gtest(SubscriberTests SOURCES ${SUBSCRIBERTESTS_SOURCE})

add_executable(DataReaderTests ${DATAREADERTESTS_SOURCE})
<<<<<<< HEAD
target_compile_definitions(DataReaderTests PRIVATE FASTRTPS_NO_LIB
=======
target_compile_definitions(DataReaderTests PRIVATE
BOOST_ASIO_STANDALONE
ASIO_STANDALONE
ASIO_DISABLE_VISIBILITY
>>>>>>> e00b8e323 (Use FASTRTPS_NO_LIB on unittest root folder (#3856))
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
Expand All @@ -50,3 +57,48 @@ target_link_libraries(DataReaderTests fastrtps fastcdr foonathan_memory
GTest::gmock
${CMAKE_DL_LIBS})
add_gtest(DataReaderTests SOURCES ${DATAREADERTESTS_SOURCE})
<<<<<<< HEAD
=======

add_executable(DataReaderInstanceTests ${DATAREADERINSTANCETESTS_SOURCE})
target_compile_definitions(DataReaderInstanceTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
target_include_directories(DataReaderInstanceTests PRIVATE
${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include
${PROJECT_SOURCE_DIR}/src/cpp
)
target_link_libraries(DataReaderInstanceTests foonathan_memory
GTest::gmock
${CMAKE_DL_LIBS})
add_gtest(DataReaderInstanceTests SOURCES ${DATAREADERINSTANCETESTS_SOURCE})

add_executable(DataReaderHistoryTests ${DATAREADERHISTORYTESTS_SOURCE})
target_compile_definitions(DataReaderHistoryTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
$<$<BOOL:${MSVC}>:NOMINMAX> # avoid conflic with std::min & std::max in visual studio
# acknowledge atomic layout issue on old versions of visual studio STL
$<$<AND:$<BOOL:${MSVC}>,$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},19.29.30140.0>>:_ENABLE_ATOMIC_ALIGNMENT_FIX>
)
target_include_directories(DataReaderHistoryTests PRIVATE
${PROJECT_SOURCE_DIR}/test/mock/rtps/RTPSReader
${PROJECT_SOURCE_DIR}/test/mock/rtps/StatelessReader
${PROJECT_SOURCE_DIR}/test/mock/dds/Topic
${PROJECT_SOURCE_DIR}/test/mock/dds/TypeSupport
${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include
${PROJECT_SOURCE_DIR}/src/cpp
${THIRDPARTY_BOOST_INCLUDE_DIR}
)
target_link_libraries(DataReaderHistoryTests fastcdr foonathan_memory
GTest::gmock
${CMAKE_DL_LIBS})
add_gtest(DataReaderHistoryTests SOURCES ${DATAREADERHISTORYTESTS_SOURCE})
if(ANDROID)
set_property(TARGET SubscriberTests PROPERTY CROSSCOMPILING_EMULATOR "adb;shell;cd;${CMAKE_CURRENT_BINARY_DIR};&&")
set_property(TARGET DataReaderTests PROPERTY CROSSCOMPILING_EMULATOR "adb;shell;cd;${CMAKE_CURRENT_BINARY_DIR};&&")
set_property(TARGET DataReaderHistoryTests PROPERTY CROSSCOMPILING_EMULATOR "adb;shell;cd;${CMAKE_CURRENT_BINARY_DIR};&&")
set_property(TARGET DataReaderInstanceTests PROPERTY CROSSCOMPILING_EMULATOR "adb;shell;cd;${CMAKE_CURRENT_BINARY_DIR};&&")
endif()
>>>>>>> e00b8e323 (Use FASTRTPS_NO_LIB on unittest root folder (#3856))
2 changes: 1 addition & 1 deletion test/unittest/dds/topic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if(WIN32)
endif()

add_executable(TopicTests ${TOPICTESTS_SOURCE})
target_compile_definitions(TopicTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(TopicTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
Expand Down
2 changes: 1 addition & 1 deletion test/unittest/dds/topic/DDSSQLFilter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ add_executable(DDSSQLFilterTests
${DDSSQLFILTER_SOURCES}
${DDSSQLFILTER_LIB_SOURCES}
)
target_compile_definitions(DDSSQLFilterTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(DDSSQLFilterTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
Expand Down
6 changes: 3 additions & 3 deletions test/unittest/dynamic_types/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ set(DYNAMIC_TYPES_4_2_TEST_SOURCE
include_directories(mock/)

add_executable(DynamicTypesTests ${DYNAMIC_TYPES_TEST_SOURCE})
target_compile_definitions(DynamicTypesTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(DynamicTypesTests PRIVATE
BOOST_ASIO_STANDALONE
ASIO_STANDALONE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
Expand Down Expand Up @@ -126,7 +126,7 @@ add_gtest(DynamicTypesTests SOURCES ${DYNAMIC_TYPES_TEST_SOURCE})


add_executable(DynamicComplexTypesTests ${DYNAMIC_COMPLEX_TYPES_TEST_SOURCE})
target_compile_definitions(DynamicComplexTypesTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(DynamicComplexTypesTests PRIVATE
BOOST_ASIO_STANDALONE
ASIO_STANDALONE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
Expand All @@ -145,7 +145,7 @@ 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
target_compile_definitions(DynamicTypes_4_2_Tests PRIVATE
BOOST_ASIO_STANDALONE
ASIO_STANDALONE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
Expand Down
4 changes: 2 additions & 2 deletions test/unittest/logging/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ set(LOGTESTS_SOURCE
include_directories(mock/)

add_executable(LogTests ${LOGTESTS_SOURCE})
target_compile_definitions(LogTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(LogTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
Expand Down Expand Up @@ -65,7 +65,7 @@ if(TINYXML2_INCLUDE_DIR)
endif(TINYXML2_INCLUDE_DIR)

add_executable(LogFileTests ${LOGFILETESTS_SOURCE})
target_compile_definitions(LogFileTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(LogFileTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
Expand Down
68 changes: 62 additions & 6 deletions test/unittest/logging/log_macros/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ set(LOGMACROS_SOURCE
${LOGMACROS_ALL_TEST_SOURCE})

add_executable(LogMacrosAllActiveTests ${LOGMACROS_SOURCE})
target_compile_definitions(LogMacrosAllActiveTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(LogMacrosAllActiveTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
Expand All @@ -51,7 +51,7 @@ set(LOGMACROS_SOURCE
${LOGMACROS_NOINFO_TEST_SOURCE})

add_executable(LogMacrosNoInfoTests ${LOGMACROS_SOURCE})
target_compile_definitions(LogMacrosNoInfoTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(LogMacrosNoInfoTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
Expand All @@ -71,7 +71,7 @@ set(LOGMACROS_SOURCE
${LOGMACROS_NOWARNING_TEST_SOURCE})

add_executable(LogMacrosNoWarningTests ${LOGMACROS_SOURCE})
target_compile_definitions(LogMacrosNoWarningTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(LogMacrosNoWarningTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
Expand All @@ -91,7 +91,7 @@ set(LOGMACROS_SOURCE
${LOGMACROS_NOERROR_TEST_SOURCE})

add_executable(LogMacrosNoErrorTests ${LOGMACROS_SOURCE})
target_compile_definitions(LogMacrosNoErrorTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(LogMacrosNoErrorTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
Expand All @@ -111,7 +111,7 @@ set(LOGMACROS_SOURCE
${LOGMACROS_DEFAULT_TEST_SOURCE})

add_executable(LogMacrosDefaultTests ${LOGMACROS_SOURCE})
target_compile_definitions(LogMacrosDefaultTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(LogMacrosDefaultTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
Expand All @@ -133,7 +133,7 @@ set(LOGMACROS_SOURCE
${LOGMACROS_INTERNALDEBUG_TEST_SOURCE})

add_executable(LogMacrosInternalDebugOffTests ${LOGMACROS_SOURCE})
target_compile_definitions(LogMacrosInternalDebugOffTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(LogMacrosInternalDebugOffTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
Expand All @@ -143,3 +143,59 @@ target_link_libraries(LogMacrosInternalDebugOffTests GTest::gtest ${MOCKS}
$<$<BOOL:${WIN32}>:iphlpapi$<SEMICOLON>Shlwapi>
)
add_gtest(LogMacrosInternalDebugOffTests SOURCES ${LOGMACROS_INTERNALDEBUG_TEST_SOURCE})
<<<<<<< HEAD
=======

# MACROS OLD LOG TEST ALL
set(LOGMACROS_ALL_TEST_SOURCE OldLogMacrosTests.cpp)

set(LOGMACROS_SOURCE
${LOG_COMMON_SOURCE}
${LOGMACROS_ALL_TEST_SOURCE})

add_executable(OldLogMacrosTests ${LOGMACROS_SOURCE})
target_compile_definitions(OldLogMacrosTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
target_include_directories(OldLogMacrosTests PRIVATE
${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include
${PROJECT_SOURCE_DIR}/src/cpp)
target_link_libraries(OldLogMacrosTests GTest::gtest ${MOCKS}
$<$<BOOL:${WIN32}>:iphlpapi$<SEMICOLON>Shlwapi>
)
add_gtest(OldLogMacrosTests SOURCES ${LOGMACROS_ALL_TEST_SOURCE})


# MACROS OLD DISABLE LOG TEST ALL
set(LOGMACROS_ALL_TEST_SOURCE OldLogMacrosDisableTests.cpp)

set(LOGMACROS_SOURCE
${LOG_COMMON_SOURCE}
${LOGMACROS_ALL_TEST_SOURCE})

add_executable(OldLogMacrosDisableTests ${LOGMACROS_SOURCE})
target_compile_definitions(OldLogMacrosDisableTests PRIVATE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
$<$<BOOL:${INTERNAL_DEBUG}>:__INTERNALDEBUG> # Internal debug activated.
)
target_include_directories(OldLogMacrosDisableTests PRIVATE
${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include
${PROJECT_SOURCE_DIR}/src/cpp)
target_link_libraries(OldLogMacrosDisableTests GTest::gtest ${MOCKS}
$<$<BOOL:${WIN32}>:iphlpapi$<SEMICOLON>Shlwapi>
)
add_gtest(OldLogMacrosDisableTests SOURCES ${LOGMACROS_ALL_TEST_SOURCE})

# SET PROPERTIES TO TESTS
if(ANDROID)
set_property(TARGET LogMacrosAllActiveTests PROPERTY CROSSCOMPILING_EMULATOR "adb;shell;cd;${CMAKE_CURRENT_BINARY_DIR};&&")
set_property(TARGET LogMacrosDefaultTests PROPERTY CROSSCOMPILING_EMULATOR "adb;shell;cd;${CMAKE_CURRENT_BINARY_DIR};&&")
set_property(TARGET LogMacrosInternalDebugOffTests PROPERTY CROSSCOMPILING_EMULATOR "adb;shell;cd;${CMAKE_CURRENT_BINARY_DIR};&&")
set_property(TARGET LogMacrosNoErrorTests PROPERTY CROSSCOMPILING_EMULATOR "adb;shell;cd;${CMAKE_CURRENT_BINARY_DIR};&&")
set_property(TARGET LogMacrosNoInfoTests PROPERTY CROSSCOMPILING_EMULATOR "adb;shell;cd;${CMAKE_CURRENT_BINARY_DIR};&&")
set_property(TARGET LogMacrosNoWarningTests PROPERTY CROSSCOMPILING_EMULATOR "adb;shell;cd;${CMAKE_CURRENT_BINARY_DIR};&&")
set_property(TARGET OldLogMacrosTests PROPERTY CROSSCOMPILING_EMULATOR "adb;shell;cd;${CMAKE_CURRENT_BINARY_DIR};&&")
set_property(TARGET OldLogMacrosDisableTests PROPERTY CROSSCOMPILING_EMULATOR "adb;shell;cd;${CMAKE_CURRENT_BINARY_DIR};&&")
endif()
>>>>>>> e00b8e323 (Use FASTRTPS_NO_LIB on unittest root folder (#3856))
2 changes: 1 addition & 1 deletion test/unittest/rtps/DataSharing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if(WIN32)
endif()

add_executable(SHMSegmentTests ${SHMSEGMENTTESTS_SOURCE})
target_compile_definitions(SHMSegmentTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(SHMSegmentTests PRIVATE
BOOST_ASIO_STANDALONE
ASIO_STANDALONE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
Expand Down
2 changes: 1 addition & 1 deletion test/unittest/rtps/builtin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if(WIN32)
endif()

add_executable(BuiltinDataSerializationTests ${BUILTIN_DATA_SERIALIZATION_TESTS_SOURCE})
target_compile_definitions(BuiltinDataSerializationTests PRIVATE FASTRTPS_NO_LIB
target_compile_definitions(BuiltinDataSerializationTests PRIVATE
BOOST_ASIO_STANDALONE
ASIO_STANDALONE
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<STREQUAL:"${CMAKE_BUILD_TYPE}","Debug">>:__DEBUG>
Expand Down
Loading

0 comments on commit 174a8cd

Please sign in to comment.