From e8c79ecbc5c15dfbe28aea8513af88b337b7b751 Mon Sep 17 00:00:00 2001 From: EduPonz Date: Sat, 24 Feb 2024 14:23:12 +0100 Subject: [PATCH] Refs #20511: Remove use of deprecated FindPythonInterp Signed-off-by: EduPonz --- cmake/common/test_wrapper.cmake.in | 6 +-- test/CTestCustom.cmake.in | 4 +- test/communication/CMakeLists.txt | 52 +++++++++++----------- test/dds/communication/CMakeLists.txt | 8 ++-- test/dds/discovery/CMakeLists.txt | 6 +-- test/performance/latency/CMakeLists.txt | 16 +++---- test/performance/throughput/CMakeLists.txt | 16 +++---- test/performance/video/CMakeLists.txt | 8 ++-- test/profiling/CMakeLists.txt | 8 ++-- test/system/tools/fastdds/CMakeLists.txt | 6 +-- test/system/tools/fds/CMakeLists.txt | 8 ++-- 11 files changed, 69 insertions(+), 69 deletions(-) diff --git a/cmake/common/test_wrapper.cmake.in b/cmake/common/test_wrapper.cmake.in index 9139acc3003..b92360e2b4c 100644 --- a/cmake/common/test_wrapper.cmake.in +++ b/cmake/common/test_wrapper.cmake.in @@ -1,8 +1,8 @@ -find_package(PythonInterp 3) +find_package(Python3 COMPONENTS Interpreter) # Clean first so the exit code comes from the second process -message(STATUS "test_wrapper - Running command: ${PYTHON_EXECUTABLE} @PROJECT_BINARY_DIR@/tools/fastdds/fastdds.py shm clean") -execute_process(COMMAND ${PYTHON_EXECUTABLE} @PROJECT_BINARY_DIR@/tools/fastdds/fastdds.py shm clean) +message(STATUS "test_wrapper - Running command: ${Python3_EXECUTABLE} @PROJECT_BINARY_DIR@/tools/fastdds/fastdds.py shm clean") +execute_process(COMMAND ${Python3_EXECUTABLE} @PROJECT_BINARY_DIR@/tools/fastdds/fastdds.py shm clean) message(STATUS "test_wrapper - Running command: ${ACTUAL_TEST} ${ACTUAL_ARGS}") execute_process(COMMAND ${ACTUAL_TEST} ${ACTUAL_ARGS}) diff --git a/test/CTestCustom.cmake.in b/test/CTestCustom.cmake.in index 839e722a201..84784c05e01 100644 --- a/test/CTestCustom.cmake.in +++ b/test/CTestCustom.cmake.in @@ -1,3 +1,3 @@ -find_package(PythonInterp 3) +find_package(Python3 COMPONENTS Interpreter REQUIRED) -execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../tools/fastdds/fastdds.py shm clean) +execute_process(COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../tools/fastdds/fastdds.py shm clean) diff --git a/test/communication/CMakeLists.txt b/test/communication/CMakeLists.txt index e19db25df79..35286517620 100644 --- a/test/communication/CMakeLists.txt +++ b/test/communication/CMakeLists.txt @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -find_package(PythonInterp 3) +find_package(Python3 COMPONENTS Interpreter) ############################################################################### # Binaries @@ -202,9 +202,9 @@ if(SECURITY) ${CMAKE_CURRENT_BINARY_DIR}/permissions_helloworld_securehelloworld.smime COPYONLY) endif() -if(PYTHONINTERP_FOUND) +if(Python3_Interpreter_FOUND) add_test(NAME SimpleCommunicationBestEffort - COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${PYTHON_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake) + COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${Python3_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake) # Set test with label NoMemoryCheck set_property(TEST SimpleCommunicationBestEffort PROPERTY LABELS "NoMemoryCheck") @@ -222,7 +222,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME SimpleCommunicationReliable - COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${PYTHON_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake) + COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${Python3_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake) # Set test with label NoMemoryCheck set_property(TEST SimpleCommunicationReliable PROPERTY LABELS "NoMemoryCheck") @@ -240,7 +240,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME SimpleCommunicationReliableBestEffort - COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${PYTHON_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake) + COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${Python3_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake) # Set test with label NoMemoryCheck set_property(TEST SimpleCommunicationReliableBestEffort PROPERTY LABELS "NoMemoryCheck") @@ -258,7 +258,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME SimpleMixCommunicationBestEffort - COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${PYTHON_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/simple_mix_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake) + COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${Python3_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/simple_mix_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake) # Set test with label NoMemoryCheck set_property(TEST SimpleMixCommunicationBestEffort PROPERTY LABELS "NoMemoryCheck") @@ -276,7 +276,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME SimpleMixCommunicationReliable - COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${PYTHON_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/simple_mix_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake) + COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${Python3_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/simple_mix_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake) # Set test with label NoMemoryCheck set_property(TEST SimpleMixCommunicationReliable PROPERTY LABELS "NoMemoryCheck") @@ -295,7 +295,7 @@ if(PYTHONINTERP_FOUND) if(SECURITY) add_test(NAME SimpleCommunicationSecureBestEffort - COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${PYTHON_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake) + COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${Python3_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake) # Set test with label NoMemoryCheck set_property(TEST SimpleCommunicationSecureBestEffort PROPERTY LABELS "NoMemoryCheck") @@ -317,7 +317,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME SimpleCommunicationSecureMsgCryptoBestEffort - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/multiple_subs_secure_crypto_communication.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/multiple_subs_secure_crypto_communication.py --pub $ --xml-pub secure_msg_crypto_besteffort_pub_profile.xml --sub $ @@ -334,7 +334,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME SimpleCommunicationSecureMsgSubmsgCryptoBestEffort - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/multiple_subs_secure_crypto_communication.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/multiple_subs_secure_crypto_communication.py --pub $ --xml-pub secure_msg_submsg_crypto_besteffort_pub_profile.xml --sub $ @@ -351,7 +351,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME SimpleCommunicationSecureSubmsgCryptoBestEffort - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/multiple_subs_secure_crypto_communication.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/multiple_subs_secure_crypto_communication.py --pub $ --xml-pub secure_submsg_crypto_besteffort_pub_profile.xml --sub $ @@ -368,7 +368,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME SecureDiscoverServerSimplePubSubSecureMsgCrypto - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/secure_ds_pubsub_secure_crypto_communication.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/secure_ds_pubsub_secure_crypto_communication.py --pub $ --xml-pub secure_ds_simple_secure_msg_crypto_pub_profile.xml --sub $ @@ -388,7 +388,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME SecureDiscoverServerSimplePubSubSecureNoDiscoveryNoRTPSProtectionMsgCrypto - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/secure_ds_pubsub_secure_crypto_communication.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/secure_ds_pubsub_secure_crypto_communication.py --pub $ --xml-pub secure_ds_simple_secure_no_discovery_no_rtps_protection_pub_profile.xml --sub $ @@ -408,7 +408,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME SecureDiscoverServerSimplePubSubSecureNoDiscoveryProtectionMsgCrypto - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/secure_ds_pubsub_secure_crypto_communication.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/secure_ds_pubsub_secure_crypto_communication.py --pub $ --xml-pub secure_ds_simple_secure_no_discovery_protection_pub_profile.xml --sub $ @@ -428,7 +428,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME SecureDiscoverServerSimplePubSubSecureNoRTPSProtectionMsgCrypto - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/secure_ds_pubsub_secure_crypto_communication.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/secure_ds_pubsub_secure_crypto_communication.py --pub $ --xml-pub secure_ds_simple_secure_no_rtps_protection_pub_profile.xml --sub $ @@ -448,7 +448,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME TwoSecureDiscoverServersSimplePubSubSecureMsgCrypto - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/multiple_secure_ds_pubsub_secure_crypto_communication.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/multiple_secure_ds_pubsub_secure_crypto_communication.py --pub $ --xml-pub secure_ds_simple_secure_msg_crypto_pub_profile.xml --sub $ @@ -467,7 +467,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME TwoSecureDiscoverServersSimplePubSubSecureNoDiscoveryNoRTPSProtectionMsgCrypto - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/multiple_secure_ds_pubsub_secure_crypto_communication.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/multiple_secure_ds_pubsub_secure_crypto_communication.py --pub $ --xml-pub secure_ds_simple_secure_no_discovery_no_rtps_protection_pub_profile.xml --sub $ @@ -486,7 +486,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME TwoSecureDiscoverServersSimplePubSubSecureNoDiscoveryProtectionMsgCrypto - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/multiple_secure_ds_pubsub_secure_crypto_communication.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/multiple_secure_ds_pubsub_secure_crypto_communication.py --pub $ --xml-pub secure_ds_simple_secure_no_discovery_protection_pub_profile.xml --sub $ @@ -505,7 +505,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME TwoSecureDiscoverServersSimplePubSubSecureNoRTPSProtectionMsgCrypto - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/multiple_secure_ds_pubsub_secure_crypto_communication.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/multiple_secure_ds_pubsub_secure_crypto_communication.py --pub $ --xml-pub secure_ds_simple_secure_no_rtps_protection_pub_profile.xml --sub $ @@ -524,7 +524,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME AllowUnauthenticatedSimplePubSecureNoRTPSProtectionSubNonSecure - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/multiple_subs_secure_crypto_communication.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/multiple_subs_secure_crypto_communication.py --n-subs 1 --pub $ --xml-pub simple_secure_allow_unauthenticated_pub_profile.xml @@ -544,7 +544,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME LivelinessAssertion - COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${PYTHON_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/liveliness_assertion.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake) + COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${Python3_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/liveliness_assertion.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake) # Set test with label NoMemoryCheck set_property(TEST LivelinessAssertion PROPERTY LABELS "NoMemoryCheck") @@ -559,7 +559,7 @@ if(PYTHONINTERP_FOUND) "PATH=$\\;$\\;${WIN_PATH}") endif() add_test(NAME AutomaticLivelinessAssertion - COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${PYTHON_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/automatic_liveliness_assertion.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake) + COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${Python3_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/automatic_liveliness_assertion.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake) # Set test with label NoMemoryCheck set_property(TEST AutomaticLivelinessAssertion PROPERTY LABELS "NoMemoryCheck") @@ -575,7 +575,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME TwoPublishersCommunicationBestEffort - COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${PYTHON_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/two_publishers_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake) + COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${Python3_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/two_publishers_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake) # Set test with label NoMemoryCheck set_property(TEST TwoPublishersCommunicationBestEffort PROPERTY LABELS "NoMemoryCheck") @@ -593,7 +593,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME TwoPublishersCommunicationReliable - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/two_publishers_communication.py) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/two_publishers_communication.py) # Set test with label NoMemoryCheck set_property(TEST TwoPublishersCommunicationReliable PROPERTY LABELS "NoMemoryCheck") @@ -611,7 +611,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME SimpleCommunicationBestEffortFixed - COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${PYTHON_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake) + COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${Python3_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake) # Set test with label NoMemoryCheck set_property(TEST SimpleCommunicationBestEffortFixed PROPERTY LABELS "NoMemoryCheck") @@ -633,7 +633,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME SHMCommunicationSubscriberDiesWhileProcessingMessage - COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${PYTHON_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/shm_communication_subscriber_dies_while_processing_message.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake) + COMMAND ${CMAKE_COMMAND} -DACTUAL_TEST=${Python3_EXECUTABLE} -DACTUAL_ARGS=${CMAKE_CURRENT_BINARY_DIR}/shm_communication_subscriber_dies_while_processing_message.py -P ${CMAKE_CURRENT_BINARY_DIR}/test_wrapper.cmake) # Set test with label NoMemoryCheck set_property(TEST SHMCommunicationSubscriberDiesWhileProcessingMessage PROPERTY LABELS "NoMemoryCheck") diff --git a/test/dds/communication/CMakeLists.txt b/test/dds/communication/CMakeLists.txt index a8d7eb04041..a046f4d299d 100644 --- a/test/dds/communication/CMakeLists.txt +++ b/test/dds/communication/CMakeLists.txt @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -find_package(PythonInterp 3) +find_package(Python3 COMPONENTS Interpreter) add_definitions( -DBOOST_ASIO_STANDALONE @@ -165,10 +165,10 @@ endif() ############################################################################### # Tests specification ############################################################################### -if(PYTHONINTERP_FOUND) +if(Python3_Interpreter_FOUND) # Dynamic types test add_test(NAME DDSSimpleCommunicationTypeDiscovery - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_communication_dynamic.py) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_communication_dynamic.py) # Set test with label NoMemoryCheck set_property(TEST DDSSimpleCommunicationTypeDiscovery PROPERTY LABELS "NoMemoryCheck") @@ -190,7 +190,7 @@ if(PYTHONINTERP_FOUND) set(TEST_NAME DDSCommunication_${TEST_DEFINITION}) add_test( NAME ${TEST_NAME} - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/${TEST_BUILDER} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/${TEST_BUILDER} ${TEST_DEFINITION}.json ) diff --git a/test/dds/discovery/CMakeLists.txt b/test/dds/discovery/CMakeLists.txt index ceff169e60c..fd4ec7eaed1 100644 --- a/test/dds/discovery/CMakeLists.txt +++ b/test/dds/discovery/CMakeLists.txt @@ -13,7 +13,7 @@ # limitations under the License. if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER) AND fastcdr_FOUND) - find_package(PythonInterp 3) + find_package(Python3 COMPONENTS Interpreter) ########################################################################### # Binaries @@ -46,9 +46,9 @@ if(NOT ((MSVC OR MSVC_IDE) AND EPROSIMA_INSTALLER) AND fastcdr_FOUND) math(EXPR W_UNICAST_PORT_RANDOM_NUMBER "${W_UNICAST_PORT_RANDOM_NUMBER} + 1024") endif() - if(PYTHONINTERP_FOUND AND NOT APPLE AND NOT WIN32) + if(Python3_Interpreter_FOUND AND NOT APPLE AND NOT WIN32) add_test(NAME AddDiscoveryServerToListFromEnvironmentFile - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/client_server_dynamic_discovery.py) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/client_server_dynamic_discovery.py) set_property(TEST AddDiscoveryServerToListFromEnvironmentFile PROPERTY ENVIRONMENT "CLIENT_SERVER_DYNAMIC_DISCOVERY_BIN=$") diff --git a/test/performance/latency/CMakeLists.txt b/test/performance/latency/CMakeLists.txt index 42d6604916e..58108782d3b 100644 --- a/test/performance/latency/CMakeLists.txt +++ b/test/performance/latency/CMakeLists.txt @@ -104,8 +104,8 @@ endforeach(latency_test_name) ########################################################################### # Create tests # ########################################################################### -find_package(PythonInterp 3 REQUIRED) -if(PYTHONINTERP_FOUND) +find_package(Python3 COMPONENTS Interpreter REQUIRED) +if(Python3_Interpreter_FOUND) # Loop over the test names foreach(latency_test_name ${LATENCY_TEST_LIST}) @@ -135,7 +135,7 @@ if(PYTHONINTERP_FOUND) # Add the test add_test( NAME performance.latency.${latency_test_name} - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/latency_tests.py ${LATENCY_TEST_BIN} --xml_file ${CMAKE_CURRENT_SOURCE_DIR}/xml/${latency_test_name}.xml @@ -172,7 +172,7 @@ if(PYTHONINTERP_FOUND) add_test( NAME performance.latency.${latency_test_name}.security - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/latency_tests.py ${LATENCY_TEST_BIN} --xml_file ${CMAKE_CURRENT_SOURCE_DIR}/xml/${latency_test_name}.xml @@ -198,7 +198,7 @@ if(PYTHONINTERP_FOUND) add_test( NAME performance.latency.${latency_test_name}.data_sharing - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/latency_tests.py ${LATENCY_TEST_BIN} --xml_file ${CMAKE_CURRENT_SOURCE_DIR}/xml/${latency_test_name}.xml @@ -218,7 +218,7 @@ if(PYTHONINTERP_FOUND) add_test( NAME performance.latency.${latency_test_name}.data_loans - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/latency_tests.py ${LATENCY_TEST_BIN} --xml_file ${CMAKE_CURRENT_SOURCE_DIR}/xml/${latency_test_name}.xml @@ -236,7 +236,7 @@ if(PYTHONINTERP_FOUND) add_test( NAME performance.latency.${latency_test_name}.data_loans.security - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/latency_tests.py ${LATENCY_TEST_BIN} --xml_file ${CMAKE_CURRENT_SOURCE_DIR}/xml/${latency_test_name}.xml @@ -265,7 +265,7 @@ if(PYTHONINTERP_FOUND) add_test( NAME performance.latency.${latency_test_name}.data_loans_and_sharing - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/latency_tests.py ${LATENCY_TEST_BIN} --xml_file ${CMAKE_CURRENT_SOURCE_DIR}/xml/${latency_test_name}.xml diff --git a/test/performance/throughput/CMakeLists.txt b/test/performance/throughput/CMakeLists.txt index f33f8505d6d..30cb02437d5 100644 --- a/test/performance/throughput/CMakeLists.txt +++ b/test/performance/throughput/CMakeLists.txt @@ -104,8 +104,8 @@ endforeach(throughput_test_name) ########################################################################### # Create tests # ########################################################################### -find_package(PythonInterp 3 REQUIRED) -if(PYTHONINTERP_FOUND) +find_package(Python3 COMPONENTS Interpreter REQUIRED) +if(Python3_Interpreter_FOUND) # Loop over the test names foreach(throughput_test_name ${THROUGHPUT_TEST_LIST}) @@ -135,7 +135,7 @@ if(PYTHONINTERP_FOUND) # Add the test add_test( NAME performance.throughput.${throughput_test_name} - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/throughput_tests.py --xml_file ${CMAKE_CURRENT_SOURCE_DIR}/xml/${throughput_test_name}.xml --recoveries_file ${CMAKE_CURRENT_SOURCE_DIR}/recoveries.csv @@ -171,7 +171,7 @@ if(PYTHONINTERP_FOUND) add_test( NAME performance.throughput.${throughput_test_name}.security - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/throughput_tests.py --xml_file ${CMAKE_CURRENT_SOURCE_DIR}/xml/${throughput_test_name}.xml --recoveries_file ${CMAKE_CURRENT_SOURCE_DIR}/recoveries.csv @@ -197,7 +197,7 @@ if(PYTHONINTERP_FOUND) add_test( NAME performance.throughput.${throughput_test_name}.data_sharing - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/throughput_tests.py --xml_file ${CMAKE_CURRENT_SOURCE_DIR}/xml/${throughput_test_name}.xml --recoveries_file ${CMAKE_CURRENT_SOURCE_DIR}/recoveries.csv @@ -217,7 +217,7 @@ if(PYTHONINTERP_FOUND) add_test( NAME performance.throughput.${throughput_test_name}.data_loans - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/throughput_tests.py --xml_file ${CMAKE_CURRENT_SOURCE_DIR}/xml/${throughput_test_name}.xml --recoveries_file ${CMAKE_CURRENT_SOURCE_DIR}/recoveries.csv @@ -234,7 +234,7 @@ if(PYTHONINTERP_FOUND) add_test( NAME performance.throughput.${throughput_test_name}.data_loans.security - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/throughput_tests.py --xml_file ${CMAKE_CURRENT_SOURCE_DIR}/xml/${throughput_test_name}.xml --recoveries_file ${CMAKE_CURRENT_SOURCE_DIR}/recoveries.csv @@ -263,7 +263,7 @@ if(PYTHONINTERP_FOUND) add_test( NAME performance.throughput.${throughput_test_name}.data_loans_and_sharing - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/throughput_tests.py --xml_file ${CMAKE_CURRENT_SOURCE_DIR}/xml/${throughput_test_name}.xml --recoveries_file ${CMAKE_CURRENT_SOURCE_DIR}/recoveries.csv diff --git a/test/performance/video/CMakeLists.txt b/test/performance/video/CMakeLists.txt index 126c15749c6..6c974fc9a16 100644 --- a/test/performance/video/CMakeLists.txt +++ b/test/performance/video/CMakeLists.txt @@ -160,15 +160,15 @@ if(GST_FOUND) ########################################################################### # Create tests # ########################################################################### - find_package(PythonInterp 3 REQUIRED) - if(PYTHONINTERP_FOUND) + find_package(Python3 COMPONENTS Interpreter REQUIRED) + if(Python3_Interpreter_FOUND) if(GST_FOUND) # Loop over the test names foreach(video_test_name ${VIDEO_TEST_LIST}) # Add the test add_test( NAME performance.video.${video_test_name} - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/video_tests.py --xml_file ${CMAKE_CURRENT_SOURCE_DIR}/xml/${video_test_name}.xml ) @@ -209,7 +209,7 @@ if(GST_FOUND) # Add the secure verison add_test( NAME performance.video.${video_test_name}_security - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/video_tests.py --xml_file ${CMAKE_CURRENT_SOURCE_DIR}/xml/${video_test_name}.xml ) diff --git a/test/profiling/CMakeLists.txt b/test/profiling/CMakeLists.txt index b54f935da35..71a4092718d 100644 --- a/test/profiling/CMakeLists.txt +++ b/test/profiling/CMakeLists.txt @@ -48,14 +48,14 @@ configure_file("cycles_tests.py" "cycles_tests.py") configure_file("memory_tests.py" "memory_tests.py") configure_file("memory_analysis.py" "memory_analysis.py") -find_package(PythonInterp 3 REQUIRED) +find_package(Python3 COMPONENTS Interpreter REQUIRED) -if(PYTHONINTERP_FOUND) +if(Python3_Interpreter_FOUND) ############################################################################### # MemoryTest ############################################################################### add_test(NAME MemoryTest - COMMAND ${PYTHON_EXECUTABLE} memory_tests.py) + COMMAND ${Python3_EXECUTABLE} memory_tests.py) # Set test with label NoMemoryCheck set_property(TEST MemoryTest PROPERTY LABELS "NoMemoryCheck") @@ -77,7 +77,7 @@ if(PYTHONINTERP_FOUND) # CyclesTest ############################################################################### add_test(NAME CyclesTest - COMMAND ${PYTHON_EXECUTABLE} cycles_tests.py) + COMMAND ${Python3_EXECUTABLE} cycles_tests.py) # Set test with label NoMemoryCheck set_property(TEST CyclesTest PROPERTY LABELS "NoMemoryCheck") diff --git a/test/system/tools/fastdds/CMakeLists.txt b/test/system/tools/fastdds/CMakeLists.txt index 82ba17dc1c8..ad28206c96e 100644 --- a/test/system/tools/fastdds/CMakeLists.txt +++ b/test/system/tools/fastdds/CMakeLists.txt @@ -16,9 +16,9 @@ # Create tests # ########################################################################### -find_package(PythonInterp 3 REQUIRED) +find_package(Python3 COMPONENTS Interpreter REQUIRED) -if(PYTHONINTERP_FOUND) +if(Python3_Interpreter_FOUND) set(TESTS test_fastdds_installed @@ -31,7 +31,7 @@ if(PYTHONINTERP_FOUND) foreach(TEST IN LISTS TESTS) add_test( NAME system.tools.fastdds.${TEST} - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tests.py ${CMAKE_INSTALL_PREFIX} ${TEST} diff --git a/test/system/tools/fds/CMakeLists.txt b/test/system/tools/fds/CMakeLists.txt index 063f91820c0..ae7fdb9950d 100644 --- a/test/system/tools/fds/CMakeLists.txt +++ b/test/system/tools/fds/CMakeLists.txt @@ -16,9 +16,9 @@ # Create tests # ########################################################################### -find_package(PythonInterp 3 REQUIRED) +find_package(Python3 COMPONENTS Interpreter REQUIRED) -if(PYTHONINTERP_FOUND) +if(Python3_Interpreter_FOUND) set(TESTS test_fast_discovery_closure @@ -97,7 +97,7 @@ if(PYTHONINTERP_FOUND) add_test( NAME system.tools.fastdds.${TEST} COMMAND powershell "-File" ${PWS_LAUNCHER} - ${PYTHON_EXECUTABLE} + ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tests.py $ ${TEST} @@ -105,7 +105,7 @@ if(PYTHONINTERP_FOUND) else() add_test( NAME system.tools.fastdds.${TEST} - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tests.py $ ${TEST}