diff --git a/controller_manager/CMakeLists.txt b/controller_manager/CMakeLists.txt index 15748c5551..1b0f308613 100644 --- a/controller_manager/CMakeLists.txt +++ b/controller_manager/CMakeLists.txt @@ -237,15 +237,10 @@ if(BUILD_TESTING) controller_manager_msgs ) - find_package(ament_cmake_ros REQUIRED) - find_package(launch_testing_ament_cmake REQUIRED) + find_package(ament_cmake_pytest REQUIRED) install(FILES test/test_ros2_control_node.yaml DESTINATION test) - function(add_ros_isolated_launch_test path) - set(RUNNER "${ament_cmake_ros_DIR}/run_test_isolated.py") - add_launch_test("${path}" RUNNER "${RUNNER}" ${ARGN}) - endfunction() - add_ros_isolated_launch_test(test/test_ros2_control_node_launch.py) + ament_add_pytest_test(test_ros2_control_node test/test_ros2_control_node_launch.py) endif() install( diff --git a/controller_manager/package.xml b/controller_manager/package.xml index 57a0e31693..48cb29b14b 100644 --- a/controller_manager/package.xml +++ b/controller_manager/package.xml @@ -32,9 +32,8 @@ generate_parameter_library ament_cmake_gmock - ament_cmake_ros + ament_cmake_pytest hardware_interface_testing - launch_testing_ament_cmake launch_testing_ros launch_testing launch diff --git a/controller_manager/test/test_ros2_control_node_launch.py b/controller_manager/test/test_ros2_control_node_launch.py index e82246ac50..b382d3b09d 100644 --- a/controller_manager/test/test_ros2_control_node_launch.py +++ b/controller_manager/test/test_ros2_control_node_launch.py @@ -28,6 +28,7 @@ # # Author: Christoph Froehlich +import pytest import unittest import os @@ -49,6 +50,7 @@ # Executes the given launch file and checks if all nodes can be started +@pytest.mark.launch_test def generate_test_description(): robot_controllers = os.path.join(