Skip to content

Commit

Permalink
Use ament_cmake_ros
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Dec 16, 2024
1 parent 22a5a87 commit 183a6b7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
9 changes: 8 additions & 1 deletion example_13/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,18 @@ install(
)

if(BUILD_TESTING)
find_package(ament_cmake_ros REQUIRED)
find_package(launch_testing_ament_cmake REQUIRED)
find_package(ament_cmake_pytest REQUIRED)

ament_add_pytest_test(example_13_urdf_xacro test/test_urdf_xacro.py)
ament_add_pytest_test(view_example_13_launch test/test_view_robot_launch.py)
ament_add_pytest_test(run_example_13_launch test/test_three_robots_launch.py)

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_three_robots_launch.py)
endif()

## EXPORTS
Expand Down
7 changes: 6 additions & 1 deletion example_13/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@
<exec_depend>xacro</exec_depend>

<test_depend>ament_cmake_pytest</test_depend>
<test_depend>launch_testing_ros</test_depend>
<test_depend>ament_cmake_ros</test_depend>
<test_depend>launch_ros</test_depend>
<test_depend>launch_testing_ament_cmake</test_depend>
<test_depend>launch_testing</test_depend>
<test_depend>launch</test_depend>
<test_depend>liburdfdom-tools</test_depend>
<test_depend>rclpy</test_depend>
<test_depend>ros2_control_demo_testing</test_depend>
<test_depend>xacro</test_depend>

Expand Down
4 changes: 1 addition & 3 deletions example_13/test/test_three_robots_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
# Author: Christoph Froehlich

import os
import pytest
import unittest
import subprocess

Expand All @@ -48,8 +47,7 @@
)


# Executes the given launch file and checks if all nodes can be started
@pytest.mark.rostest
# Executes the given launch file
def generate_test_description():
launch_include = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
Expand Down

0 comments on commit 183a6b7

Please sign in to comment.