Skip to content

Commit

Permalink
Use pytest again, does coverage work?
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Dec 18, 2024
1 parent 246114c commit df209eb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
9 changes: 2 additions & 7 deletions controller_manager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 1 addition & 2 deletions controller_manager/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@
<depend>generate_parameter_library</depend>

<test_depend>ament_cmake_gmock</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_cmake_pytest</test_depend>
<test_depend>hardware_interface_testing</test_depend>
<test_depend>launch_testing_ament_cmake</test_depend>
<test_depend>launch_testing_ros</test_depend>
<test_depend>launch_testing</test_depend>
<test_depend>launch</test_depend>
Expand Down
2 changes: 2 additions & 0 deletions controller_manager/test/test_ros2_control_node_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#
# Author: Christoph Froehlich

import pytest
import unittest
import os

Expand All @@ -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(
Expand Down

0 comments on commit df209eb

Please sign in to comment.