diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 2d12d3687fe..0fe3dbb418b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -29,12 +29,18 @@ set(MEMORYCHECK_SUPPRESSIONS_FILE ${MEMORYCHECK_SUPPRESSIONS_FILE_TMP} CACHE FIL # Check if /etc/hosts file has been modified to add dummy host test subjects if(WIN32) - execute_process(COMMAND powershell -C Resolve-DNSName www.acme.com.test + execute_process(COMMAND powershell -C Resolve-DNSName -Name www.acme.com.test -CacheOnly RESULT_VARIABLE EPROSIMA_TEST_DNS_NOT_SET_UP OUTPUT_QUIET ERROR_QUIET) -else(WIN32) +elseif(APPLE) + execute_process( + COMMAND dscacheutil -q host -a name www.acme.com.test + COMMAND grep www.acme.com.test + RESULT_VARIABLE EPROSIMA_TEST_DNS_NOT_SET_UP OUTPUT_QUIET ERROR_QUIET) +else() execute_process(COMMAND getent hosts www.acme.com.test RESULT_VARIABLE EPROSIMA_TEST_DNS_NOT_SET_UP OUTPUT_QUIET ERROR_QUIET) -endif(WIN32) +endif() +message(STATUS "EPROSIMA_TEST_DNS_NOT_SET_UP: '${EPROSIMA_TEST_DNS_NOT_SET_UP}'") ############################################################################### # Testing diff --git a/test/blackbox/CMakeLists.txt b/test/blackbox/CMakeLists.txt index 541dead905e..3d6c2b4d33e 100644 --- a/test/blackbox/CMakeLists.txt +++ b/test/blackbox/CMakeLists.txt @@ -47,13 +47,20 @@ endif() # Filter pksc11 related tests if library is not available if(NOT LibP11_FOUND) - set(pkcs_filter "-*pkcs*") + set(pkcs_filter "*pkcs*") endif() # LibP11_FOUND if(EPROSIMA_TEST_DNS_NOT_SET_UP) - set(dns_filter "-*ServerClientEnvironmentSetUpDNS*") + set(dns_filter "*ServerClientEnvironmentSetUpDNS*") endif() +string(JOIN ":" BLACKBOX_HIGH_LEVEL_IGNORED_TESTS ${pkcs_filter} ${dns_filter}) +if(NOT BLACKBOX_HIGH_LEVEL_IGNORED_TESTS STREQUAL "") + message(STATUS "Ignoring tests '${BLACKBOX_HIGH_LEVEL_IGNORED_TESTS}'") + string(PREPEND BLACKBOX_HIGH_LEVEL_IGNORED_TESTS "-") +endif() +message(STATUS "BLACKBOX_HIGH_LEVEL_IGNORED_TESTS set to '${BLACKBOX_HIGH_LEVEL_IGNORED_TESTS}'") + file(GLOB RTPS_BLACKBOXTESTS_TEST_SOURCE "common/RTPSBlackboxTests*.cpp") set(RTPS_BLACKBOXTESTS_SOURCE ${RTPS_BLACKBOXTESTS_TEST_SOURCE} types/Data1mb.cxx @@ -100,7 +107,7 @@ target_include_directories(BlackboxTests_RTPS PRIVATE target_link_libraries(BlackboxTests_RTPS fastrtps fastcdr foonathan_memory GTest::gtest) gtest_discover_tests(BlackboxTests_RTPS TEST_PREFIX "BlackboxTests_RTPS." - TEST_FILTER ${pkcs_filter} + TEST_FILTER ${BLACKBOX_HIGH_LEVEL_IGNORED_TESTS} NO_PRETTY_VALUES ) @@ -226,7 +233,7 @@ if(FASTRTPS_API_TESTS) ENVIRONMENT "MULTICAST_PORT_RANDOM_NUMBER=${MULTICAST_PORT_RANDOM_NUMBER}" ENVIRONMENT $,OPENSSL_CONF=${OPENSSL_CONF},> TEST_PREFIX "BlackboxTests_FastRTPS." - TEST_FILTER ${pkcs_filter} ${dns_filter} + TEST_FILTER ${BLACKBOX_HIGH_LEVEL_IGNORED_TESTS} NO_PRETTY_VALUES ) endif(FASTRTPS_API_TESTS) @@ -281,7 +288,7 @@ if(FASTDDS_PIM_API_TESTS) ENVIRONMENT "MULTICAST_PORT_RANDOM_NUMBER=${MULTICAST_PORT_RANDOM_NUMBER}" ENVIRONMENT $,OPENSSL_CONF=${OPENSSL_CONF},> TEST_PREFIX "BlackboxTests_DDS_PIM." - TEST_FILTER ${pkcs_filter} ${dns_filter} + TEST_FILTER ${BLACKBOX_HIGH_LEVEL_IGNORED_TESTS} NO_PRETTY_VALUES ) endif(FASTDDS_PIM_API_TESTS) diff --git a/test/unittest/dds/participant/CMakeLists.txt b/test/unittest/dds/participant/CMakeLists.txt index 927239c6b51..9982d19b89b 100644 --- a/test/unittest/dds/participant/CMakeLists.txt +++ b/test/unittest/dds/participant/CMakeLists.txt @@ -47,6 +47,7 @@ target_link_libraries(ParticipantTests fastrtps fastcdr foonathan_memory ${CMAKE_DL_LIBS}) if(EPROSIMA_TEST_DNS_NOT_SET_UP) + message(STATUS "Ignoring 'ParticipantTests.SimpleParticipantRemoteServerListConfigurationDNS'") set(dns_filter "-ParticipantTests.SimpleParticipantRemoteServerListConfigurationDNS") endif() diff --git a/test/unittest/utils/CMakeLists.txt b/test/unittest/utils/CMakeLists.txt index ce3534c8954..4bcbcf3d804 100644 --- a/test/unittest/utils/CMakeLists.txt +++ b/test/unittest/utils/CMakeLists.txt @@ -119,18 +119,11 @@ if(QNX) target_link_libraries(LocatorTests socket) endif() if(EPROSIMA_TEST_DNS_NOT_SET_UP) - set(IGNORE_COMMAND LocatorDNSTests) + message(STATUS "Ignoring 'LocatorDNSTests*'") + set(IGNORE_COMMAND "-LocatorDNSTests*") endif() gtest_discover_tests(LocatorTests TEST_FILTER ${IGNORE_COMMAND}) unset(IGNORE_COMMAND) -# Skip DNS related tests when not running on our CI -if(NOT(EPROSIMA_BUILD)) - message(STATUS "Ignoring DNS tests") - set(CTEST_CUSTOM_TESTS_IGNORE - ${CTEST_CUSTOM_TESTS_IGNORE} - LocatorDNSTests - ) -endif() add_executable(FixedSizeQueueTests ${FIXEDSIZEQUEUETESTS_SOURCE}) target_include_directories(FixedSizeQueueTests PRIVATE