diff --git a/.github/workflows/reusable-ubuntu-ci.yml b/.github/workflows/reusable-ubuntu-ci.yml index c6a7738bdd6..a6a48070fad 100644 --- a/.github/workflows/reusable-ubuntu-ci.yml +++ b/.github/workflows/reusable-ubuntu-ci.yml @@ -56,6 +56,11 @@ jobs: path: src/fastrtps ref: ${{ inputs.fastdds-branch }} + - name: Install Fix Python version + uses: eProsima/eProsima-CI/external/setup-python@v0 + with: + python-version: '3.11' + - name: Get minimum supported version of CMake uses: eProsima/eProsima-CI/external/get-cmake@v0 with: @@ -114,12 +119,15 @@ jobs: ref: ${{ steps.get_shapes_demo_branch.outputs.deduced_branch }} # Required for Shapes Demo + # Do not setup python as it will internally modify the pythonLocation env variable + # and we want to use a fix version - name: Install Qt uses: jurplel/install-qt-action@v2.13.0 with: version: '5.15.2' dir: '${{ github.workspace }}/qt_installation/' modules: 'qtcharts' + setup-python: 'false' - name: Colcon build continue-on-error: false diff --git a/.github/workflows/reusable-windows-ci.yml b/.github/workflows/reusable-windows-ci.yml index 2583c0586dc..ebc79427190 100644 --- a/.github/workflows/reusable-windows-ci.yml +++ b/.github/workflows/reusable-windows-ci.yml @@ -56,6 +56,11 @@ jobs: submodules: true ref: ${{ inputs.fastdds_branch }} + - name: Install Fix Python version + uses: eProsima/eProsima-CI/external/setup-python@v0 + with: + python-version: '3.11' + - name: Get minimum supported version of CMake uses: eProsima/eProsima-CI/external/get-cmake@v0 with: diff --git a/test/communication/CMakeLists.txt b/test/communication/CMakeLists.txt index 21c6aa7a8c1..79d49643ba3 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 @@ -196,9 +196,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 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py) # Set test with label NoMemoryCheck set_property(TEST SimpleCommunicationBestEffort PROPERTY LABELS "NoMemoryCheck") @@ -216,7 +216,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME SimpleCommunicationReliable - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py) # Set test with label NoMemoryCheck set_property(TEST SimpleCommunicationReliable PROPERTY LABELS "NoMemoryCheck") @@ -234,7 +234,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME SimpleCommunicationReliableBestEffort - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py) # Set test with label NoMemoryCheck set_property(TEST SimpleCommunicationReliableBestEffort PROPERTY LABELS "NoMemoryCheck") @@ -252,7 +252,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME SimpleMixCommunicationBestEffort - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_mix_communication.py) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_mix_communication.py) # Set test with label NoMemoryCheck set_property(TEST SimpleMixCommunicationBestEffort PROPERTY LABELS "NoMemoryCheck") @@ -270,7 +270,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME SimpleMixCommunicationReliable - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_mix_communication.py) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_mix_communication.py) # Set test with label NoMemoryCheck set_property(TEST SimpleMixCommunicationReliable PROPERTY LABELS "NoMemoryCheck") @@ -289,7 +289,7 @@ if(PYTHONINTERP_FOUND) if(SECURITY) add_test(NAME SimpleCommunicationSecureBestEffort - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py) # Set test with label NoMemoryCheck set_property(TEST SimpleCommunicationSecureBestEffort PROPERTY LABELS "NoMemoryCheck") @@ -311,7 +311,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 $ @@ -328,7 +328,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 $ @@ -345,7 +345,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 $ @@ -362,7 +362,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 $ @@ -382,7 +382,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 $ @@ -402,7 +402,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 $ @@ -422,7 +422,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 $ @@ -442,7 +442,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 $ @@ -461,7 +461,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 $ @@ -480,7 +480,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 $ @@ -499,7 +499,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 $ @@ -518,7 +518,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 @@ -538,7 +538,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME LivelinessAssertion - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/liveliness_assertion.py) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/liveliness_assertion.py) # Set test with label NoMemoryCheck set_property(TEST LivelinessAssertion PROPERTY LABELS "NoMemoryCheck") @@ -553,7 +553,7 @@ if(PYTHONINTERP_FOUND) "PATH=$\\;$\\;${WIN_PATH}") endif() add_test(NAME AutomaticLivelinessAssertion - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/automatic_liveliness_assertion.py) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/automatic_liveliness_assertion.py) # Set test with label NoMemoryCheck set_property(TEST AutomaticLivelinessAssertion PROPERTY LABELS "NoMemoryCheck") @@ -569,7 +569,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME TwoPublishersCommunicationBestEffort - 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 TwoPublishersCommunicationBestEffort PROPERTY LABELS "NoMemoryCheck") @@ -587,7 +587,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") @@ -605,7 +605,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME SimpleCommunicationBestEffortFixed - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/simple_communication.py) # Set test with label NoMemoryCheck set_property(TEST SimpleCommunicationBestEffortFixed PROPERTY LABELS "NoMemoryCheck") @@ -627,7 +627,7 @@ if(PYTHONINTERP_FOUND) endif() add_test(NAME SHMCommunicationSubscriberDiesWhileProcessingMessage - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/shm_communication_subscriber_dies_while_processing_message.py) + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/shm_communication_subscriber_dies_while_processing_message.py) # 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 9b2790faa1f..d099dac93ce 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 @@ -161,10 +161,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") @@ -186,7 +186,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 1304aa9900a..f8585e6685e 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 @@ -42,9 +42,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 bdc578a3eec..e0cec9f76d9 100644 --- a/test/system/tools/fastdds/CMakeLists.txt +++ b/test/system/tools/fastdds/CMakeLists.txt @@ -16,9 +16,13 @@ # Create tests # ########################################################################### -find_package(PythonInterp 3 REQUIRED) +find_package(Python3 COMPONENTS Interpreter REQUIRED) -if(PYTHONINTERP_FOUND) +if(Python3_Interpreter_FOUND) + + # Set environment for tests + set(TEST_ENVIRONMENT + "PYTHON_VERSION=${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}") set(TESTS test_fastdds_installed @@ -31,7 +35,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} @@ -43,129 +47,140 @@ if(PYTHONINTERP_FOUND) PROPERTY LABELS "NoMemoryCheck" ) + # Set test properties + set_property( + TEST system.tools.fastdds.${TEST} + PROPERTY ENVIRONMENT ${TEST_ENVIRONMENT} + ) + endforeach() -endif() + ############################################################################### + # XML GENERAL validation + ############################################################################### + message(STATUS "Configuring CLI xml validation...") -############################################################################### -# XML GENERAL validation -############################################################################### -message(STATUS "Configuring CLI xml validation...") + # Configure command based on the OS running + if (MSVC) + set(env_fast_command "fastdds.bat") # WINDOWS + else() + set(env_fast_command "fastdds") # POSIX + endif() -# Configure command based on the OS running -if (MSVC) - set(env_fast_command "fastdds.bat") # WINDOWS -else() - set(env_fast_command "fastdds") # POSIX -endif() + # Copy the examples validation files over to the build directory + file(GLOB_RECURSE XML_EXAMPLE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../../examples/*_profile.xml) + # for each xml file detected + foreach(XML_EXAMPLE_FILE_COMPLETE_PATH ${XML_EXAMPLE_FILES}) + # obtain the file name + get_filename_component(XML_EXAMPLE_FILE ${XML_EXAMPLE_FILE_COMPLETE_PATH} NAME_WE) + # copy the file from src to build folders + configure_file( + ${XML_EXAMPLE_FILE_COMPLETE_PATH} # from full src path + ${CMAKE_CURRENT_BINARY_DIR}/xmldocuments/examples/${XML_EXAMPLE_FILE}.xml # to relative build path + COPYONLY) + endforeach() -# Copy the examples validation files over to the build directory -file(GLOB_RECURSE XML_EXAMPLE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../../examples/*_profile.xml) -# for each xml file detected -foreach(XML_EXAMPLE_FILE_COMPLETE_PATH ${XML_EXAMPLE_FILES}) - # obtain the file name - get_filename_component(XML_EXAMPLE_FILE ${XML_EXAMPLE_FILE_COMPLETE_PATH} NAME_WE) - # copy the file from src to build folders - configure_file( - ${XML_EXAMPLE_FILE_COMPLETE_PATH} # from full src path - ${CMAKE_CURRENT_BINARY_DIR}/xmldocuments/examples/${XML_EXAMPLE_FILE}.xml # to relative build path - COPYONLY) -endforeach() - -# Copy the blackbox tests validation files over to the build directory -file(GLOB_RECURSE XML_BLACKBOX_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../blackbox/*_profile.xml) -# for each xml file detected -foreach(XML_BLACKBOX_FILE_COMPLETE_PATH ${XML_BLACKBOX_FILES}) - # obtain the file name - get_filename_component(XML_BLACKBOX_FILE ${XML_BLACKBOX_FILE_COMPLETE_PATH} NAME_WE) - # copy the file from src to build folders - configure_file( - ${XML_BLACKBOX_FILE_COMPLETE_PATH} # from full src path - ${CMAKE_CURRENT_BINARY_DIR}/xmldocuments/test/blackbox/${XML_BLACKBOX_FILE}.xml # to relative build path - COPYONLY) -endforeach() - -# Copy the unit tests validation files over to the build directory -file(GLOB_RECURSE XML_UNITTEST_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../unittest/*_profile.xml) -# for each xml file detected -foreach(XML_UNITTEST_FILE_COMPLETE_PATH ${XML_UNITTEST_FILES}) - # obtain the file name - get_filename_component(XML_UNITTEST_FILE ${XML_UNITTEST_FILE_COMPLETE_PATH} NAME_WE) - # copy the file from src to build folders - configure_file( - ${XML_UNITTEST_FILE_COMPLETE_PATH} # from full src path - ${CMAKE_CURRENT_BINARY_DIR}/xmldocuments/test/unittest/${XML_UNITTEST_FILE}.xml # to relative build path - COPYONLY) -endforeach() - -# Copy the system tests validation files over to the build directory -file(GLOB_RECURSE XML_SYSTEM_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../*_profile.xml) -# for each xml file detected -foreach(XML_SYSTEM_FILE_COMPLETE_PATH ${XML_SYSTEM_FILES}) - # obtain the file name - get_filename_component(XML_SYSTEM_FILE ${XML_SYSTEM_FILE_COMPLETE_PATH} NAME_WE) - # copy the file from src to build folders - configure_file( - ${XML_SYSTEM_FILE_COMPLETE_PATH} # from full src path - ${CMAKE_CURRENT_BINARY_DIR}/xmldocuments/test/system/${XML_SYSTEM_FILE}.xml # to relative build path - COPYONLY) -endforeach() - -# Copy the comunication tests validation files over to the build directory -file(GLOB_RECURSE XML_COMMUNICATION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../communication/*_profile.xml) -# for each xml file detected -foreach(XML_COMMUNICATION_FILE_COMPLETE_PATH ${XML_COMMUNICATION_FILES}) - # obtain the file name - get_filename_component(XML_COMMUNICATION_FILE ${XML_COMMUNICATION_FILE_COMPLETE_PATH} NAME_WE) - # copy the file from src to build folders - configure_file( - ${XML_COMMUNICATION_FILE_COMPLETE_PATH} # from full src path - ${CMAKE_CURRENT_BINARY_DIR}/xmldocuments/test/communication/${XML_COMMUNICATION_FILE}.xml # to relative build path - COPYONLY) -endforeach() - -# Copy the dds tests validation files over to the build directory -file(GLOB_RECURSE XML_DDS_TEST_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../dds/*_profile.xml) -# for each xml file detected -foreach(XML_DDS_TEST_FILE_COMPLETE_PATH ${XML_DDS_TEST_FILES}) - # obtain the file name - get_filename_component(XML_DDS_TEST_FILE ${XML_DDS_TEST_FILE_COMPLETE_PATH} NAME_WE) - # copy the file from src to build folders - configure_file( - ${XML_DDS_TEST_FILE_COMPLETE_PATH} # from full src path - ${CMAKE_CURRENT_BINARY_DIR}/xmldocuments/test/dds/${XML_DDS_TEST_FILE}.xml # to relative build path - COPYONLY) -endforeach() - -if(PERFORMANCE_TESTS) - # Copy the performance tests validation files over to the build directory - file(GLOB_RECURSE XML_PERFORMANCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../performance/*_profile.xml) + # Copy the blackbox tests validation files over to the build directory + file(GLOB_RECURSE XML_BLACKBOX_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../blackbox/*_profile.xml) # for each xml file detected - foreach(XML_PERFORMANCE_FILE_COMPLETE_PATH ${XML_PERFORMANCE_FILES}) + foreach(XML_BLACKBOX_FILE_COMPLETE_PATH ${XML_BLACKBOX_FILES}) # obtain the file name - get_filename_component(XML_PERFORMANCE_FILE ${XML_PERFORMANCE_FILE_COMPLETE_PATH} NAME_WE) + get_filename_component(XML_BLACKBOX_FILE ${XML_BLACKBOX_FILE_COMPLETE_PATH} NAME_WE) # copy the file from src to build folders configure_file( - ${XML_PERFORMANCE_FILE_COMPLETE_PATH} # from full src path - ${CMAKE_CURRENT_BINARY_DIR}/xmldocuments/test/performance/${XML_PERFORMANCE_FILE}.xml # to relative build path + ${XML_BLACKBOX_FILE_COMPLETE_PATH} # from full src path + ${CMAKE_CURRENT_BINARY_DIR}/xmldocuments/test/blackbox/${XML_BLACKBOX_FILE}.xml # to relative build path COPYONLY) endforeach() -endif() -if(PROFILING_TESTS) - # Copy the profiling tests validation files over to the build directory - file(GLOB_RECURSE XML_PROFILING_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../profiling/*_profile.xml) + # Copy the unit tests validation files over to the build directory + file(GLOB_RECURSE XML_UNITTEST_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../unittest/*_profile.xml) # for each xml file detected - foreach(XML_PROFILING_FILE_COMPLETE_PATH ${XML_PROFILING_FILES}) + foreach(XML_UNITTEST_FILE_COMPLETE_PATH ${XML_UNITTEST_FILES}) # obtain the file name - get_filename_component(XML_PROFILING_FILE ${XML_PROFILING_FILE_COMPLETE_PATH} NAME_WE) + get_filename_component(XML_UNITTEST_FILE ${XML_UNITTEST_FILE_COMPLETE_PATH} NAME_WE) # copy the file from src to build folders configure_file( - ${XML_PROFILING_FILE_COMPLETE_PATH} # from full src path - ${CMAKE_CURRENT_BINARY_DIR}/xmldocuments/test/profiling/${XML_PROFILING_FILE}.xml # to relative build path + ${XML_UNITTEST_FILE_COMPLETE_PATH} # from full src path + ${CMAKE_CURRENT_BINARY_DIR}/xmldocuments/test/unittest/${XML_UNITTEST_FILE}.xml # to relative build path + COPYONLY) + endforeach() + + # Copy the system tests validation files over to the build directory + file(GLOB_RECURSE XML_SYSTEM_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../*_profile.xml) + # for each xml file detected + foreach(XML_SYSTEM_FILE_COMPLETE_PATH ${XML_SYSTEM_FILES}) + # obtain the file name + get_filename_component(XML_SYSTEM_FILE ${XML_SYSTEM_FILE_COMPLETE_PATH} NAME_WE) + # copy the file from src to build folders + configure_file( + ${XML_SYSTEM_FILE_COMPLETE_PATH} # from full src path + ${CMAKE_CURRENT_BINARY_DIR}/xmldocuments/test/system/${XML_SYSTEM_FILE}.xml # to relative build path + COPYONLY) + endforeach() + + # Copy the comunication tests validation files over to the build directory + file(GLOB_RECURSE XML_COMMUNICATION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../communication/*_profile.xml) + # for each xml file detected + foreach(XML_COMMUNICATION_FILE_COMPLETE_PATH ${XML_COMMUNICATION_FILES}) + # obtain the file name + get_filename_component(XML_COMMUNICATION_FILE ${XML_COMMUNICATION_FILE_COMPLETE_PATH} NAME_WE) + # copy the file from src to build folders + configure_file( + ${XML_COMMUNICATION_FILE_COMPLETE_PATH} # from full src path + ${CMAKE_CURRENT_BINARY_DIR}/xmldocuments/test/communication/${XML_COMMUNICATION_FILE}.xml # to relative build path COPYONLY) endforeach() -endif() -# Define test -add_test(NAME xml.validate COMMAND ${env_fast_command} xml validate xmldocuments) + # Copy the dds tests validation files over to the build directory + file(GLOB_RECURSE XML_DDS_TEST_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../dds/*_profile.xml) + # for each xml file detected + foreach(XML_DDS_TEST_FILE_COMPLETE_PATH ${XML_DDS_TEST_FILES}) + # obtain the file name + get_filename_component(XML_DDS_TEST_FILE ${XML_DDS_TEST_FILE_COMPLETE_PATH} NAME_WE) + # copy the file from src to build folders + configure_file( + ${XML_DDS_TEST_FILE_COMPLETE_PATH} # from full src path + ${CMAKE_CURRENT_BINARY_DIR}/xmldocuments/test/dds/${XML_DDS_TEST_FILE}.xml # to relative build path + COPYONLY) + endforeach() + + if(PERFORMANCE_TESTS) + # Copy the performance tests validation files over to the build directory + file(GLOB_RECURSE XML_PERFORMANCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../performance/*_profile.xml) + # for each xml file detected + foreach(XML_PERFORMANCE_FILE_COMPLETE_PATH ${XML_PERFORMANCE_FILES}) + # obtain the file name + get_filename_component(XML_PERFORMANCE_FILE ${XML_PERFORMANCE_FILE_COMPLETE_PATH} NAME_WE) + # copy the file from src to build folders + configure_file( + ${XML_PERFORMANCE_FILE_COMPLETE_PATH} # from full src path + ${CMAKE_CURRENT_BINARY_DIR}/xmldocuments/test/performance/${XML_PERFORMANCE_FILE}.xml # to relative build path + COPYONLY) + endforeach() + endif() + + if(PROFILING_TESTS) + # Copy the profiling tests validation files over to the build directory + file(GLOB_RECURSE XML_PROFILING_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../profiling/*_profile.xml) + # for each xml file detected + foreach(XML_PROFILING_FILE_COMPLETE_PATH ${XML_PROFILING_FILES}) + # obtain the file name + get_filename_component(XML_PROFILING_FILE ${XML_PROFILING_FILE_COMPLETE_PATH} NAME_WE) + # copy the file from src to build folders + configure_file( + ${XML_PROFILING_FILE_COMPLETE_PATH} # from full src path + ${CMAKE_CURRENT_BINARY_DIR}/xmldocuments/test/profiling/${XML_PROFILING_FILE}.xml # to relative build path + COPYONLY) + endforeach() + endif() + + # Define test + add_test(NAME xml.validate COMMAND ${env_fast_command} xml validate xmldocuments) + # Set test properties + set_property( + TEST xml.validate + PROPERTY ENVIRONMENT ${TEST_ENVIRONMENT} + ) + +endif() 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} diff --git a/tools/fastdds/fastdds.bat b/tools/fastdds/fastdds.bat index 9bbcc0d6aa0..de259c851d9 100644 --- a/tools/fastdds/fastdds.bat +++ b/tools/fastdds/fastdds.bat @@ -20,5 +20,15 @@ if not %ERRORLEVEL%==0 ( exit /B 65 ) ) -:: Use launcher to profit from shebang hints on fastdds.py -py "%dir%\..\tools\fastdds\fastdds.py" %args% + +:: Python version in the form "Major.Minor" +if not "%PYTHON_VERSION%" == "" ( + :: Use launcher to profit from shebang hints on fastdds.py + :: Select the correct python version to source the appropriate paths + py -%PYTHON_VERSION% "%dir%\..\tools\fastdds\fastdds.py" %args% +) else ( + :: Use launcher to profit from shebang hints on fastdds.py + :: Select latest available python version + py "%dir%\..\tools\fastdds\fastdds.py" %args% +) + diff --git a/tools/fastdds/ros-discovery.bat b/tools/fastdds/ros-discovery.bat index ac1875e8195..66380408acc 100644 --- a/tools/fastdds/ros-discovery.bat +++ b/tools/fastdds/ros-discovery.bat @@ -20,5 +20,15 @@ if not %ERRORLEVEL%==0 ( exit /B 65 ) ) -:: Use launcher to profit from shebang hints on fastdds.py -py "%dir%\..\tools\fastdds\fastdds.py" discovery %args% + +:: Python version in the form "Major.Minor" +if not "%PYTHON_VERSION%" == "" ( + :: Use launcher to profit from shebang hints on fastdds.py + :: Select the correct python version to source the appropriate paths + py -%PYTHON_VERSION% "%dir%\..\tools\fastdds\fastdds.py" discovery %args% +) else ( + :: Use launcher to profit from shebang hints on fastdds.py + :: Select latest available python version + py "%dir%\..\tools\fastdds\fastdds.py" discovery %args% +) +