moveit2
The MoveIt Motion Planning Framework for ROS 2.
Loading...
Searching...
No Matches
unittest_trajectory_functions.test.py
Go to the documentation of this file.
1import launch_testing
2import pytest
3import unittest
4
5from launch import LaunchDescription
6from launch_ros.actions import Node
7from launch_testing.util import KeepAliveProc
8
9import sys
10import os
11
12sys.path.append(os.path.dirname(__file__))
13from common_parameters import load_moveit_config, load_yaml
14
15
16@pytest.mark.rostest
18 # Load the context
19 test_config = load_moveit_config()
20
21 test_param = load_yaml(
22 "pilz_industrial_motion_planner", "config/unittest_trajectory_functions.yaml"
23 )
24
25 # run test
26 unittest_trajectory_functions = Node(
27 package="pilz_industrial_motion_planner",
28 executable="unittest_trajectory_functions",
29 name="unittest_trajectory_functions",
30 parameters=[
31 test_config.to_dict(),
32 test_param,
33 ],
34 output="screen",
35 )
36 return (
37 LaunchDescription(
38 [
39 unittest_trajectory_functions,
40 KeepAliveProc(),
41 launch_testing.actions.ReadyToTest(),
42 ]
43 ),
44 {"unittest_trajectory_functions": unittest_trajectory_functions},
45 )
46
47
48class TestTerminatingProcessStops(unittest.TestCase):
49 def test_gtest_run_complete(self, proc_info, unittest_trajectory_functions):
50 proc_info.assertWaitForShutdown(
51 process=unittest_trajectory_functions, timeout=4000.0
52 )
53
54
55@launch_testing.post_shutdown_test()
56class TestOutcome(unittest.TestCase):
57 def test_exit_codes(self, proc_info, unittest_trajectory_functions):
58 launch_testing.asserts.assertExitCodes(
59 proc_info, process=unittest_trajectory_functions
60 )
test_exit_codes(self, proc_info, unittest_trajectory_functions)
test_gtest_run_complete(self, proc_info, unittest_trajectory_functions)