moveit2
The MoveIt Motion Planning Framework for ROS 2.
Loading...
Searching...
No Matches
unittest_trajectory_generator_common.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",
23 "config/unittest_trajectory_generator_common.yaml",
24 )
25
26 # run test
27 unittest_trajectory_generator_common = Node(
28 package="pilz_industrial_motion_planner",
29 executable="unittest_trajectory_generator_common",
30 name="unittest_trajectory_generator_common",
31 parameters=[
32 test_config.to_dict(),
33 test_param,
34 ],
35 output="screen",
36 )
37 return (
38 LaunchDescription(
39 [
40 unittest_trajectory_generator_common,
41 KeepAliveProc(),
42 launch_testing.actions.ReadyToTest(),
43 ]
44 ),
45 {"unittest_trajectory_generator_common": unittest_trajectory_generator_common},
46 )
47
48
49class TestTerminatingProcessStops(unittest.TestCase):
50 def test_gtest_run_complete(self, proc_info, unittest_trajectory_generator_common):
51 proc_info.assertWaitForShutdown(
52 process=unittest_trajectory_generator_common, timeout=4000.0
53 )
54
55
56@launch_testing.post_shutdown_test()
57class TestOutcome(unittest.TestCase):
58 def test_exit_codes(self, proc_info, unittest_trajectory_generator_common):
59 launch_testing.asserts.assertExitCodes(
60 proc_info, process=unittest_trajectory_generator_common
61 )
test_exit_codes(self, proc_info, unittest_trajectory_generator_common)