From f1531811bbf83e7f86d9adabbb1c800c0f01bdd1 Mon Sep 17 00:00:00 2001 From: Audrow Date: Tue, 30 Jun 2020 15:44:29 -0700 Subject: [PATCH 1/7] Update tests to avoid using buildin_interfaces Signed-off-by: Audrow --- ros2interface/test/test_cli.py | 484 +++++++-------------------------- 1 file changed, 104 insertions(+), 380 deletions(-) diff --git a/ros2interface/test/test_cli.py b/ros2interface/test/test_cli.py index f72619f4d..42b7723ac 100644 --- a/ros2interface/test/test_cli.py +++ b/ros2interface/test/test_cli.py @@ -236,76 +236,64 @@ def test_packages_with_actions(self): def test_show_message(self): with self.launch_interface_command( - arguments=['show', 'test_msgs/msg/BasicTypes'] + arguments=['show', 'test_msgs/msg/ShortVariedMultiNested'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK assert launch_testing.tools.expect_output( expected_lines=[ - 'bool bool_value', - 'byte byte_value', - 'char char_value', - 'float32 float32_value', - 'float64 float64_value', - 'int8 int8_value', - 'uint8 uint8_value', - 'int16 int16_value', - 'uint16 uint16_value', - 'int32 int32_value', - 'uint32 uint32_value', - 'int64 int64_value', - 'uint64 uint64_value', + '# A short, varied, and nested type', + 'ShortVariedNested short_varied_nested # Comment - Nesting Level 3: 1 of 1', + '\tShortVaried short_varied', + '\t\tbool BOOL_CONST=true', + '\t\tbool bool_value', + '\t\tbool[<=3] bool_values', + '# Trailing comment', ], text=interface_command.output, strict=True ) - def test_show_all_comments_for_message(self): + def test_show_message_with_all_comments(self): with self.launch_interface_command( - arguments=['show', 'test_msgs/msg/Builtins', '--all-comments'] + arguments=['show', 'test_msgs/msg/ShortVariedMultiNested', '--all-comments'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK assert launch_testing.tools.expect_output( expected_lines=[ - 'builtin_interfaces/Duration duration_value', - '\t# Duration defines a period between two time points.', - '\t# Messages of this datatype are of ROS Time following this design:', - '\t# https://design.ros2.org/articles/clock_and_time.html', - '', - '\t# Seconds component, range is valid over any possible int32 value.', - '\tint32 sec', + '# A short, varied, and nested type', + 'ShortVariedNested short_varied_nested # Comment - Nesting Level 3: 1 of 1', + '\t# A short, varied type', + '\tShortVaried short_varied # Comment - Nesting Level 2: 1 of 1', + '\t\t# A constant', + '\t\tbool BOOL_CONST=true # Comment - Nesting Level 1: 1 of 2', '', - '\t# Nanoseconds component in the range of [0, 10e9).', - '\tuint32 nanosec', - 'builtin_interfaces/Time time_value', - '\t# This message communicates ROS Time defined here:', - '\t# https://design.ros2.org/articles/clock_and_time.html', + '\t\t# Bool and array of bools', + '\t\tbool bool_value', + '\t\tbool[<=3] bool_values # Comment - Nesting Level 1: 2 of 2', '', - '\t# The seconds component, valid over all int32 values.', - '\tint32 sec', - '', - '\t# The nanoseconds component, valid in the range [0, 10e9).', - '\tuint32 nanosec', + '\t\t# Trailing comment', + '\t# Trailing comment', + '# Trailing comment', ], text=interface_command.output, strict=True ) - def test_show_no_comments_for_message(self): + def test_show_message_with_no_comments(self): with self.launch_interface_command( - arguments=['show', 'test_msgs/msg/Builtins', '--no-comments'] + arguments=['show', 'test_msgs/msg/ShortVariedMultiNested', '--no-comments'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK assert launch_testing.tools.expect_output( expected_lines=[ - 'builtin_interfaces/Duration duration_value', - '\tint32 sec', - '\tuint32 nanosec', - 'builtin_interfaces/Time time_value', - '\tint32 sec', - '\tuint32 nanosec', + 'ShortVariedNested short_varied_nested', + '\tShortVaried short_varied', + '\t\tbool BOOL_CONST=true', + '\t\tbool bool_value', + '\t\tbool[<=3] bool_values', ], text=interface_command.output, strict=True @@ -313,413 +301,149 @@ def test_show_no_comments_for_message(self): def test_show_service(self): with self.launch_interface_command( - arguments=['show', 'test_msgs/srv/BasicTypes'] + arguments=['show', 'test_msgs/srv/ShortVariedMultiNested'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK assert launch_testing.tools.expect_output( expected_lines=[ - 'bool bool_value', - 'byte byte_value', - 'char char_value', - 'float32 float32_value', - 'float64 float64_value', - 'int8 int8_value', - 'uint8 uint8_value', - 'int16 int16_value', - 'uint16 uint16_value', - 'int32 int32_value', - 'uint32 uint32_value', - 'int64 int64_value', - 'uint64 uint64_value', - 'string string_value', + '# Request', + 'ShortVariedNested short_varied_nested # Comment - Nesting Level 3: 1 of 2', + '\tShortVaried short_varied', + '\t\tbool BOOL_CONST=true', + '\t\tbool bool_value', + '\t\tbool[<=3] bool_values', '---', - 'bool bool_value', - 'byte byte_value', - 'char char_value', - 'float32 float32_value', - 'float64 float64_value', - 'int8 int8_value', - 'uint8 uint8_value', - 'int16 int16_value', - 'uint16 uint16_value', - 'int32 int32_value', - 'uint32 uint32_value', - 'int64 int64_value', - 'uint64 uint64_value', - 'string string_value', + '# Response', + 'bool bool_value # Comment - Nesting Level 3: 2 of 2', ], text=interface_command.output, strict=True ) - def test_show_action(self): + def test_show_service_with_all_comments(self): with self.launch_interface_command( - arguments=['show', 'test_msgs/action/Fibonacci'] + arguments=['show', 'test_msgs/srv/ShortVariedMultiNested', '--all-comments'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK assert launch_testing.tools.expect_output( expected_lines=[ - '#goal definition', - 'int32 order', - '---', - '#result definition', - 'int32[] sequence', + '# Request', + 'ShortVariedNested short_varied_nested # Comment - Nesting Level 3: 1 of 2', + '\t# A short, varied type', + '\tShortVaried short_varied # Comment - Nesting Level 2: 1 of 1', + '\t\t# A constant', + '\t\tbool BOOL_CONST=true # Comment - Nesting Level 1: 1 of 2', + '', + '\t\t# Bool and array of bools', + '\t\tbool bool_value', + '\t\tbool[<=3] bool_values # Comment - Nesting Level 1: 2 of 2', + '', + '\t\t# Trailing comment', + '\t# Trailing comment', '---', - '#feedback', - 'int32[] sequence', + '# Response', + 'bool bool_value # Comment - Nesting Level 3: 2 of 2', ], text=interface_command.output, strict=True ) - def test_show_nested_message(self): + def test_show_service_with_no_comments(self): with self.launch_interface_command( - arguments=['show', 'test_msgs/msg/Nested'] + arguments=['show', 'test_msgs/srv/ShortVariedMultiNested', '--no-comments'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK assert launch_testing.tools.expect_output( expected_lines=[ - 'BasicTypes basic_types_value', - '\tbool bool_value', - '\tbyte byte_value', - '\tchar char_value', - '\tfloat32 float32_value', - '\tfloat64 float64_value', - '\tint8 int8_value', - '\tuint8 uint8_value', - '\tint16 int16_value', - '\tuint16 uint16_value', - '\tint32 int32_value', - '\tuint32 uint32_value', - '\tint64 int64_value', - '\tuint64 uint64_value', + 'ShortVariedNested short_varied_nested', + '\tShortVaried short_varied', + '\t\tbool BOOL_CONST=true', + '\t\tbool bool_value', + '\t\tbool[<=3] bool_values', + '---', + 'bool bool_value', ], text=interface_command.output, strict=True ) - def test_show_nested_action(self): + def test_show_action(self): with self.launch_interface_command( - arguments=['show', 'test_msgs/action/NestedMessage'] + arguments=['show', 'test_msgs/action/ShortVariedMultiNested'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK assert launch_testing.tools.expect_output( expected_lines=[ - '# goal definition', - 'Builtins nested_field_no_pkg', - '\tbuiltin_interfaces/Duration duration_value', - '\t\tint32 sec', - '\t\tuint32 nanosec', - '\tbuiltin_interfaces/Time time_value', - '\t\tint32 sec', - '\t\tuint32 nanosec', - 'test_msgs/BasicTypes nested_field', - '\tbool bool_value', - '\tbyte byte_value', - '\tchar char_value', - '\tfloat32 float32_value', - '\tfloat64 float64_value', - '\tint8 int8_value', - '\tuint8 uint8_value', - '\tint16 int16_value', - '\tuint16 uint16_value', - '\tint32 int32_value', - '\tuint32 uint32_value', - '\tint64 int64_value', - '\tuint64 uint64_value', - 'builtin_interfaces/Time nested_different_pkg', - '\tint32 sec', - '\tuint32 nanosec', + '# Goal definition', + 'ShortVariedNested short_varied_nested # Comment - Nesting Level 3: 1 of 2', + '\tShortVaried short_varied', + '\t\tbool BOOL_CONST=true', + '\t\tbool bool_value', + '\t\tbool[<=3] bool_values', '---', - '# result definition', - 'Builtins nested_field_no_pkg', - '\tbuiltin_interfaces/Duration duration_value', - '\t\tint32 sec', - '\t\tuint32 nanosec', - '\tbuiltin_interfaces/Time time_value', - '\t\tint32 sec', - '\t\tuint32 nanosec', - 'test_msgs/BasicTypes nested_field', - '\tbool bool_value', - '\tbyte byte_value', - '\tchar char_value', - '\tfloat32 float32_value', - '\tfloat64 float64_value', - '\tint8 int8_value', - '\tuint8 uint8_value', - '\tint16 int16_value', - '\tuint16 uint16_value', - '\tint32 int32_value', - '\tuint32 uint32_value', - '\tint64 int64_value', - '\tuint64 uint64_value', - 'builtin_interfaces/Time nested_different_pkg', - '\tint32 sec', - '\tuint32 nanosec', + '# Result definition', + 'bool bool_value # Comment - Nesting Level 3: 2 of 2', '---', - '# feedback', - 'Builtins nested_field_no_pkg', - '\tbuiltin_interfaces/Duration duration_value', - '\t\tint32 sec', - '\t\tuint32 nanosec', - '\tbuiltin_interfaces/Time time_value', - '\t\tint32 sec', - '\t\tuint32 nanosec', - 'test_msgs/BasicTypes nested_field', - '\tbool bool_value', - '\tbyte byte_value', - '\tchar char_value', - '\tfloat32 float32_value', - '\tfloat64 float64_value', - '\tint8 int8_value', - '\tuint8 uint8_value', - '\tint16 int16_value', - '\tuint16 uint16_value', - '\tint32 int32_value', - '\tuint32 uint32_value', - '\tint64 int64_value', - '\tuint64 uint64_value', - 'builtin_interfaces/Time nested_different_pkg', - '\tint32 sec', - '\tuint32 nanosec', + '# Feedback definition', + 'bool[3] bool_values', ], text=interface_command.output, strict=True ) - def test_show_no_comments_for_nested_action(self): + def test_show_action_with_all_comments(self): with self.launch_interface_command( - arguments=['show', 'test_msgs/action/NestedMessage', '--no-comments'] + arguments=['show', 'test_msgs/action/ShortVariedMultiNested', '--all-comments'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK assert launch_testing.tools.expect_output( expected_lines=[ - 'Builtins nested_field_no_pkg', - '\tbuiltin_interfaces/Duration duration_value', - '\t\tint32 sec', - '\t\tuint32 nanosec', - '\tbuiltin_interfaces/Time time_value', - '\t\tint32 sec', - '\t\tuint32 nanosec', - 'test_msgs/BasicTypes nested_field', - '\tbool bool_value', - '\tbyte byte_value', - '\tchar char_value', - '\tfloat32 float32_value', - '\tfloat64 float64_value', - '\tint8 int8_value', - '\tuint8 uint8_value', - '\tint16 int16_value', - '\tuint16 uint16_value', - '\tint32 int32_value', - '\tuint32 uint32_value', - '\tint64 int64_value', - '\tuint64 uint64_value', - 'builtin_interfaces/Time nested_different_pkg', - '\tint32 sec', - '\tuint32 nanosec', + '# Goal definition', + 'ShortVariedNested short_varied_nested # Comment - Nesting Level 3: 1 of 2', + '\t# A short, varied type', + '\tShortVaried short_varied # Comment - Nesting Level 2: 1 of 1', + '\t\t# A constant', + '\t\tbool BOOL_CONST=true # Comment - Nesting Level 1: 1 of 2', + '', + '\t\t# Bool and array of bools', + '\t\tbool bool_value', + '\t\tbool[<=3] bool_values # Comment - Nesting Level 1: 2 of 2', + '', + '\t\t# Trailing comment', + '\t# Trailing comment', '---', - 'Builtins nested_field_no_pkg', - '\tbuiltin_interfaces/Duration duration_value', - '\t\tint32 sec', - '\t\tuint32 nanosec', - '\tbuiltin_interfaces/Time time_value', - '\t\tint32 sec', - '\t\tuint32 nanosec', - 'test_msgs/BasicTypes nested_field', - '\tbool bool_value', - '\tbyte byte_value', - '\tchar char_value', - '\tfloat32 float32_value', - '\tfloat64 float64_value', - '\tint8 int8_value', - '\tuint8 uint8_value', - '\tint16 int16_value', - '\tuint16 uint16_value', - '\tint32 int32_value', - '\tuint32 uint32_value', - '\tint64 int64_value', - '\tuint64 uint64_value', - 'builtin_interfaces/Time nested_different_pkg', - '\tint32 sec', - '\tuint32 nanosec', + '# Result definition', + 'bool bool_value # Comment - Nesting Level 3: 2 of 2', '---', - 'Builtins nested_field_no_pkg', - '\tbuiltin_interfaces/Duration duration_value', - '\t\tint32 sec', - '\t\tuint32 nanosec', - '\tbuiltin_interfaces/Time time_value', - '\t\tint32 sec', - '\t\tuint32 nanosec', - 'test_msgs/BasicTypes nested_field', - '\tbool bool_value', - '\tbyte byte_value', - '\tchar char_value', - '\tfloat32 float32_value', - '\tfloat64 float64_value', - '\tint8 int8_value', - '\tuint8 uint8_value', - '\tint16 int16_value', - '\tuint16 uint16_value', - '\tint32 int32_value', - '\tuint32 uint32_value', - '\tint64 int64_value', - '\tuint64 uint64_value', - 'builtin_interfaces/Time nested_different_pkg', - '\tint32 sec', - '\tuint32 nanosec', + '# Feedback definition', + 'bool[3] bool_values', ], text=interface_command.output, strict=True ) - def test_show_all_comments_for_nested_action(self): + def test_show_action_with_no_comments(self): with self.launch_interface_command( - arguments=['show', 'test_msgs/action/NestedMessage', '--all-comments'] + arguments=['show', 'test_msgs/action/ShortVariedMultiNested', '--no-comments'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK assert launch_testing.tools.expect_output( expected_lines=[ - '# goal definition', - 'Builtins nested_field_no_pkg', - '\tbuiltin_interfaces/Duration duration_value', - '\t\t# Duration defines a period between two time points.', - '\t\t# Messages of this datatype are of ROS Time following this design:', - '\t\t# https://design.ros2.org/articles/clock_and_time.html', - '', - '\t\t# Seconds component, range is valid over any possible int32 value.', - '\t\tint32 sec', - '', - '\t\t# Nanoseconds component in the range of [0, 10e9).', - '\t\tuint32 nanosec', - '\tbuiltin_interfaces/Time time_value', - '\t\t# This message communicates ROS Time defined here:', - '\t\t# https://design.ros2.org/articles/clock_and_time.html', - '', - '\t\t# The seconds component, valid over all int32 values.', - '\t\tint32 sec', - '', - '\t\t# The nanoseconds component, valid in the range [0, 10e9).', - '\t\tuint32 nanosec', - 'test_msgs/BasicTypes nested_field', - '\tbool bool_value', - '\tbyte byte_value', - '\tchar char_value', - '\tfloat32 float32_value', - '\tfloat64 float64_value', - '\tint8 int8_value', - '\tuint8 uint8_value', - '\tint16 int16_value', - '\tuint16 uint16_value', - '\tint32 int32_value', - '\tuint32 uint32_value', - '\tint64 int64_value', - '\tuint64 uint64_value', - 'builtin_interfaces/Time nested_different_pkg', - '\t# This message communicates ROS Time defined here:', - '\t# https://design.ros2.org/articles/clock_and_time.html', - '', - '\t# The seconds component, valid over all int32 values.', - '\tint32 sec', - '', - '\t# The nanoseconds component, valid in the range [0, 10e9).', - '\tuint32 nanosec', + 'ShortVariedNested short_varied_nested', + '\tShortVaried short_varied', + '\t\tbool BOOL_CONST=true', + '\t\tbool bool_value', + '\t\tbool[<=3] bool_values', '---', - '# result definition', - 'Builtins nested_field_no_pkg', - '\tbuiltin_interfaces/Duration duration_value', - '\t\t# Duration defines a period between two time points.', - '\t\t# Messages of this datatype are of ROS Time following this design:', - '\t\t# https://design.ros2.org/articles/clock_and_time.html', - '', - '\t\t# Seconds component, range is valid over any possible int32 value.', - '\t\tint32 sec', - '', - '\t\t# Nanoseconds component in the range of [0, 10e9).', - '\t\tuint32 nanosec', - '\tbuiltin_interfaces/Time time_value', - '\t\t# This message communicates ROS Time defined here:', - '\t\t# https://design.ros2.org/articles/clock_and_time.html', - '', - '\t\t# The seconds component, valid over all int32 values.', - '\t\tint32 sec', - '', - '\t\t# The nanoseconds component, valid in the range [0, 10e9).', - '\t\tuint32 nanosec', - 'test_msgs/BasicTypes nested_field', - '\tbool bool_value', - '\tbyte byte_value', - '\tchar char_value', - '\tfloat32 float32_value', - '\tfloat64 float64_value', - '\tint8 int8_value', - '\tuint8 uint8_value', - '\tint16 int16_value', - '\tuint16 uint16_value', - '\tint32 int32_value', - '\tuint32 uint32_value', - '\tint64 int64_value', - '\tuint64 uint64_value', - 'builtin_interfaces/Time nested_different_pkg', - '\t# This message communicates ROS Time defined here:', - '\t# https://design.ros2.org/articles/clock_and_time.html', - '', - '\t# The seconds component, valid over all int32 values.', - '\tint32 sec', - '', - '\t# The nanoseconds component, valid in the range [0, 10e9).', - '\tuint32 nanosec', + 'bool bool_value', '---', - '# feedback', - 'Builtins nested_field_no_pkg', - '\tbuiltin_interfaces/Duration duration_value', - '\t\t# Duration defines a period between two time points.', - '\t\t# Messages of this datatype are of ROS Time following this design:', - '\t\t# https://design.ros2.org/articles/clock_and_time.html', - '', - '\t\t# Seconds component, range is valid over any possible int32 value.', - '\t\tint32 sec', - '', - '\t\t# Nanoseconds component in the range of [0, 10e9).', - '\t\tuint32 nanosec', - '\tbuiltin_interfaces/Time time_value', - '\t\t# This message communicates ROS Time defined here:', - '\t\t# https://design.ros2.org/articles/clock_and_time.html', - '', - '\t\t# The seconds component, valid over all int32 values.', - '\t\tint32 sec', - '', - '\t\t# The nanoseconds component, valid in the range [0, 10e9).', - '\t\tuint32 nanosec', - 'test_msgs/BasicTypes nested_field', - '\tbool bool_value', - '\tbyte byte_value', - '\tchar char_value', - '\tfloat32 float32_value', - '\tfloat64 float64_value', - '\tint8 int8_value', - '\tuint8 uint8_value', - '\tint16 int16_value', - '\tuint16 uint16_value', - '\tint32 int32_value', - '\tuint32 uint32_value', - '\tint64 int64_value', - '\tuint64 uint64_value', - 'builtin_interfaces/Time nested_different_pkg', - '\t# This message communicates ROS Time defined here:', - '\t# https://design.ros2.org/articles/clock_and_time.html', - '', - '\t# The seconds component, valid over all int32 values.', - '\tint32 sec', - '', - '\t# The nanoseconds component, valid in the range [0, 10e9).', - '\tuint32 nanosec', + 'bool[3] bool_values', ], text=interface_command.output, strict=True From 0a288054edcdd30307bad32505d2d97ae593c340 Mon Sep 17 00:00:00 2001 From: Audrow Nash Date: Thu, 17 Dec 2020 15:17:27 -0800 Subject: [PATCH 2/7] Create ros2cli_test_msgs package with interfaces Signed-off-by: Audrow Nash --- ros2cli_test_msgs/CMakeLists.txt | 26 +++++++++++++++++++ .../action/ShortVariedMultiNested.action | 8 ++++++ ros2cli_test_msgs/msg/ShortVaried.msg | 8 ++++++ .../msg/ShortVariedMultiNested.msg | 3 +++ ros2cli_test_msgs/msg/ShortVariedNested.msg | 3 +++ ros2cli_test_msgs/package.xml | 26 +++++++++++++++++++ .../srv/ShortVariedMultiNested.srv | 5 ++++ 7 files changed, 79 insertions(+) create mode 100644 ros2cli_test_msgs/CMakeLists.txt create mode 100644 ros2cli_test_msgs/action/ShortVariedMultiNested.action create mode 100644 ros2cli_test_msgs/msg/ShortVaried.msg create mode 100644 ros2cli_test_msgs/msg/ShortVariedMultiNested.msg create mode 100644 ros2cli_test_msgs/msg/ShortVariedNested.msg create mode 100644 ros2cli_test_msgs/package.xml create mode 100644 ros2cli_test_msgs/srv/ShortVariedMultiNested.srv diff --git a/ros2cli_test_msgs/CMakeLists.txt b/ros2cli_test_msgs/CMakeLists.txt new file mode 100644 index 000000000..ac08e3d80 --- /dev/null +++ b/ros2cli_test_msgs/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.5) +project(ros2cli_test_msgs) + +# Default to C++14 +if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 14) +endif() +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-Wall -Wextra -Wpedantic) +endif() + +find_package(ament_cmake REQUIRED) +find_package(rosidl_default_generators REQUIRED) + +rosidl_generate_interfaces(${PROJECT_NAME} + "action/ShortVariedMultiNested.action" + "msg/ShortVaried.msg" + "msg/ShortVariedMultiNested.msg" + "msg/ShortVariedNested.msg" + "srv/ShortVariedMultiNested.srv" + ADD_LINTER_TESTS +) + +ament_export_dependencies(rosidl_default_runtime) + +ament_package() diff --git a/ros2cli_test_msgs/action/ShortVariedMultiNested.action b/ros2cli_test_msgs/action/ShortVariedMultiNested.action new file mode 100644 index 000000000..73fe8fa13 --- /dev/null +++ b/ros2cli_test_msgs/action/ShortVariedMultiNested.action @@ -0,0 +1,8 @@ +# Goal definition +ShortVariedNested short_varied_nested # Comment - Nesting Level 3: 1 of 2 +--- +# Result definition +bool bool_value # Comment - Nesting Level 3: 2 of 2 +--- +# Feedback definition +bool[3] bool_values diff --git a/ros2cli_test_msgs/msg/ShortVaried.msg b/ros2cli_test_msgs/msg/ShortVaried.msg new file mode 100644 index 000000000..ab6479bc8 --- /dev/null +++ b/ros2cli_test_msgs/msg/ShortVaried.msg @@ -0,0 +1,8 @@ +# A constant +bool BOOL_CONST=true # Comment - Nesting Level 1: 1 of 2 + +# Bool and array of bools +bool bool_value +bool[<=3] bool_values # Comment - Nesting Level 1: 2 of 2 + +# Trailing comment diff --git a/ros2cli_test_msgs/msg/ShortVariedMultiNested.msg b/ros2cli_test_msgs/msg/ShortVariedMultiNested.msg new file mode 100644 index 000000000..2035f5ac2 --- /dev/null +++ b/ros2cli_test_msgs/msg/ShortVariedMultiNested.msg @@ -0,0 +1,3 @@ +# A short, varied, and nested type +ShortVariedNested short_varied_nested # Comment - Nesting Level 3: 1 of 1 +# Trailing comment diff --git a/ros2cli_test_msgs/msg/ShortVariedNested.msg b/ros2cli_test_msgs/msg/ShortVariedNested.msg new file mode 100644 index 000000000..984566bb8 --- /dev/null +++ b/ros2cli_test_msgs/msg/ShortVariedNested.msg @@ -0,0 +1,3 @@ +# A short, varied type +ShortVaried short_varied # Comment - Nesting Level 2: 1 of 1 +# Trailing comment diff --git a/ros2cli_test_msgs/package.xml b/ros2cli_test_msgs/package.xml new file mode 100644 index 000000000..3eb93a51d --- /dev/null +++ b/ros2cli_test_msgs/package.xml @@ -0,0 +1,26 @@ + + + + ros2cli_test_msgs + 1.0.1 + A package containing interface definitions for testing ros2cli. + Audrow Nash + Apache License 2.0 + Audrow Nash + + ament_cmake + + rosidl_default_generators + + action_msgs + + rosidl_default_runtime + + ament_lint_common + + rosidl_interface_packages + + + ament_cmake + + diff --git a/ros2cli_test_msgs/srv/ShortVariedMultiNested.srv b/ros2cli_test_msgs/srv/ShortVariedMultiNested.srv new file mode 100644 index 000000000..763470fa8 --- /dev/null +++ b/ros2cli_test_msgs/srv/ShortVariedMultiNested.srv @@ -0,0 +1,5 @@ +# Request +ShortVariedNested short_varied_nested # Comment - Nesting Level 3: 1 of 2 +--- +# Response +bool bool_value # Comment - Nesting Level 3: 2 of 2 From f09c3ee164c006df9a5a2dc2e0ce653a42faa6be Mon Sep 17 00:00:00 2001 From: Audrow Nash Date: Thu, 17 Dec 2020 15:18:13 -0800 Subject: [PATCH 3/7] Update ros2interface show to use ros2cli_test_msgs Signed-off-by: Audrow Nash --- ros2interface/package.xml | 1 + ros2interface/test/test_cli.py | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ros2interface/package.xml b/ros2interface/package.xml index c04a22fbe..101c872a6 100644 --- a/ros2interface/package.xml +++ b/ros2interface/package.xml @@ -24,6 +24,7 @@ ament_xmllint python3-pytest ros_testing + ros2cli_test_msgs test_msgs diff --git a/ros2interface/test/test_cli.py b/ros2interface/test/test_cli.py index 42b7723ac..67a1223f6 100644 --- a/ros2interface/test/test_cli.py +++ b/ros2interface/test/test_cli.py @@ -236,7 +236,7 @@ def test_packages_with_actions(self): def test_show_message(self): with self.launch_interface_command( - arguments=['show', 'test_msgs/msg/ShortVariedMultiNested'] + arguments=['show', 'ros2cli_test_msgs/msg/ShortVariedMultiNested'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK @@ -256,7 +256,7 @@ def test_show_message(self): def test_show_message_with_all_comments(self): with self.launch_interface_command( - arguments=['show', 'test_msgs/msg/ShortVariedMultiNested', '--all-comments'] + arguments=['show', 'ros2cli_test_msgs/msg/ShortVariedMultiNested', '--all-comments'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK @@ -283,7 +283,7 @@ def test_show_message_with_all_comments(self): def test_show_message_with_no_comments(self): with self.launch_interface_command( - arguments=['show', 'test_msgs/msg/ShortVariedMultiNested', '--no-comments'] + arguments=['show', 'ros2cli_test_msgs/msg/ShortVariedMultiNested', '--no-comments'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK @@ -301,7 +301,7 @@ def test_show_message_with_no_comments(self): def test_show_service(self): with self.launch_interface_command( - arguments=['show', 'test_msgs/srv/ShortVariedMultiNested'] + arguments=['show', 'ros2cli_test_msgs/srv/ShortVariedMultiNested'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK @@ -323,7 +323,8 @@ def test_show_service(self): def test_show_service_with_all_comments(self): with self.launch_interface_command( - arguments=['show', 'test_msgs/srv/ShortVariedMultiNested', '--all-comments'] + arguments=[ + 'show', 'ros2cli_test_msgs/srv/ShortVariedMultiNested', '--all-comments'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK @@ -352,7 +353,7 @@ def test_show_service_with_all_comments(self): def test_show_service_with_no_comments(self): with self.launch_interface_command( - arguments=['show', 'test_msgs/srv/ShortVariedMultiNested', '--no-comments'] + arguments=['show', 'ros2cli_test_msgs/srv/ShortVariedMultiNested', '--no-comments'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK @@ -372,7 +373,7 @@ def test_show_service_with_no_comments(self): def test_show_action(self): with self.launch_interface_command( - arguments=['show', 'test_msgs/action/ShortVariedMultiNested'] + arguments=['show', 'ros2cli_test_msgs/action/ShortVariedMultiNested'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK @@ -397,7 +398,8 @@ def test_show_action(self): def test_show_action_with_all_comments(self): with self.launch_interface_command( - arguments=['show', 'test_msgs/action/ShortVariedMultiNested', '--all-comments'] + arguments=[ + 'show', 'ros2cli_test_msgs/action/ShortVariedMultiNested', '--all-comments'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK @@ -429,7 +431,8 @@ def test_show_action_with_all_comments(self): def test_show_action_with_no_comments(self): with self.launch_interface_command( - arguments=['show', 'test_msgs/action/ShortVariedMultiNested', '--no-comments'] + arguments=[ + 'show', 'ros2cli_test_msgs/action/ShortVariedMultiNested', '--no-comments'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK @@ -463,7 +466,7 @@ def test_show_not_a_package(self): def test_show_not_an_interface(self): with self.launch_interface_command( - arguments=['show', 'test_msgs/msg/NotAMessageTypeName'] + arguments=['show', 'ros2cli_test_msgs/msg/NotAMessageTypeName'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == 1 From d7fa4464bbf40694a46328683abefc6880ee9b45 Mon Sep 17 00:00:00 2001 From: Audrow Nash Date: Thu, 17 Dec 2020 15:18:43 -0800 Subject: [PATCH 4/7] List ros2cli_test_msgs as a test dependency of ros2cli Signed-off-by: Audrow Nash --- ros2cli/package.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/ros2cli/package.xml b/ros2cli/package.xml index c815b0b12..1a3b5fe6f 100644 --- a/ros2cli/package.xml +++ b/ros2cli/package.xml @@ -24,6 +24,7 @@ ament_pep257 ament_xmllint python3-pytest + ros2cli_test_msgs test_msgs From 7c53031dec3796eec27c20df28b338d2544bdb58 Mon Sep 17 00:00:00 2001 From: Audrow Nash Date: Fri, 18 Dec 2020 20:39:19 -0800 Subject: [PATCH 5/7] Change ros2cli_test_msgs to ros2cli_test_interfaces Signed-off-by: Audrow Nash --- .../CMakeLists.txt | 2 +- .../action/ShortVariedMultiNested.action | 0 .../msg/ShortVaried.msg | 0 .../msg/ShortVariedMultiNested.msg | 0 .../msg/ShortVariedNested.msg | 0 .../package.xml | 5 ++-- .../srv/ShortVariedMultiNested.srv | 0 ros2interface/test/test_cli.py | 27 ++++++++++++------- 8 files changed, 21 insertions(+), 13 deletions(-) rename {ros2cli_test_msgs => ros2cli_test_interfaces}/CMakeLists.txt (95%) rename {ros2cli_test_msgs => ros2cli_test_interfaces}/action/ShortVariedMultiNested.action (100%) rename {ros2cli_test_msgs => ros2cli_test_interfaces}/msg/ShortVaried.msg (100%) rename {ros2cli_test_msgs => ros2cli_test_interfaces}/msg/ShortVariedMultiNested.msg (100%) rename {ros2cli_test_msgs => ros2cli_test_interfaces}/msg/ShortVariedNested.msg (100%) rename {ros2cli_test_msgs => ros2cli_test_interfaces}/package.xml (80%) rename {ros2cli_test_msgs => ros2cli_test_interfaces}/srv/ShortVariedMultiNested.srv (100%) diff --git a/ros2cli_test_msgs/CMakeLists.txt b/ros2cli_test_interfaces/CMakeLists.txt similarity index 95% rename from ros2cli_test_msgs/CMakeLists.txt rename to ros2cli_test_interfaces/CMakeLists.txt index ac08e3d80..e8134a071 100644 --- a/ros2cli_test_msgs/CMakeLists.txt +++ b/ros2cli_test_interfaces/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.5) -project(ros2cli_test_msgs) +project(ros2cli_test_interfaces) # Default to C++14 if(NOT CMAKE_CXX_STANDARD) diff --git a/ros2cli_test_msgs/action/ShortVariedMultiNested.action b/ros2cli_test_interfaces/action/ShortVariedMultiNested.action similarity index 100% rename from ros2cli_test_msgs/action/ShortVariedMultiNested.action rename to ros2cli_test_interfaces/action/ShortVariedMultiNested.action diff --git a/ros2cli_test_msgs/msg/ShortVaried.msg b/ros2cli_test_interfaces/msg/ShortVaried.msg similarity index 100% rename from ros2cli_test_msgs/msg/ShortVaried.msg rename to ros2cli_test_interfaces/msg/ShortVaried.msg diff --git a/ros2cli_test_msgs/msg/ShortVariedMultiNested.msg b/ros2cli_test_interfaces/msg/ShortVariedMultiNested.msg similarity index 100% rename from ros2cli_test_msgs/msg/ShortVariedMultiNested.msg rename to ros2cli_test_interfaces/msg/ShortVariedMultiNested.msg diff --git a/ros2cli_test_msgs/msg/ShortVariedNested.msg b/ros2cli_test_interfaces/msg/ShortVariedNested.msg similarity index 100% rename from ros2cli_test_msgs/msg/ShortVariedNested.msg rename to ros2cli_test_interfaces/msg/ShortVariedNested.msg diff --git a/ros2cli_test_msgs/package.xml b/ros2cli_test_interfaces/package.xml similarity index 80% rename from ros2cli_test_msgs/package.xml rename to ros2cli_test_interfaces/package.xml index 3eb93a51d..1d7aa367d 100644 --- a/ros2cli_test_msgs/package.xml +++ b/ros2cli_test_interfaces/package.xml @@ -1,10 +1,11 @@ - ros2cli_test_msgs + ros2cli_test_interfaces 1.0.1 A package containing interface definitions for testing ros2cli. - Audrow Nash + Claire Wang + Mabel Zhang Apache License 2.0 Audrow Nash diff --git a/ros2cli_test_msgs/srv/ShortVariedMultiNested.srv b/ros2cli_test_interfaces/srv/ShortVariedMultiNested.srv similarity index 100% rename from ros2cli_test_msgs/srv/ShortVariedMultiNested.srv rename to ros2cli_test_interfaces/srv/ShortVariedMultiNested.srv diff --git a/ros2interface/test/test_cli.py b/ros2interface/test/test_cli.py index 67a1223f6..8f1c91c5b 100644 --- a/ros2interface/test/test_cli.py +++ b/ros2interface/test/test_cli.py @@ -236,7 +236,7 @@ def test_packages_with_actions(self): def test_show_message(self): with self.launch_interface_command( - arguments=['show', 'ros2cli_test_msgs/msg/ShortVariedMultiNested'] + arguments=['show', 'ros2cli_test_interfaces/msg/ShortVariedMultiNested'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK @@ -256,7 +256,8 @@ def test_show_message(self): def test_show_message_with_all_comments(self): with self.launch_interface_command( - arguments=['show', 'ros2cli_test_msgs/msg/ShortVariedMultiNested', '--all-comments'] + arguments=[ + 'show', 'ros2cli_test_interfaces/msg/ShortVariedMultiNested', '--all-comments'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK @@ -283,7 +284,8 @@ def test_show_message_with_all_comments(self): def test_show_message_with_no_comments(self): with self.launch_interface_command( - arguments=['show', 'ros2cli_test_msgs/msg/ShortVariedMultiNested', '--no-comments'] + arguments=[ + 'show', 'ros2cli_test_interfaces/msg/ShortVariedMultiNested', '--no-comments'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK @@ -301,7 +303,7 @@ def test_show_message_with_no_comments(self): def test_show_service(self): with self.launch_interface_command( - arguments=['show', 'ros2cli_test_msgs/srv/ShortVariedMultiNested'] + arguments=['show', 'ros2cli_test_interfaces/srv/ShortVariedMultiNested'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK @@ -324,7 +326,7 @@ def test_show_service(self): def test_show_service_with_all_comments(self): with self.launch_interface_command( arguments=[ - 'show', 'ros2cli_test_msgs/srv/ShortVariedMultiNested', '--all-comments'] + 'show', 'ros2cli_test_interfaces/srv/ShortVariedMultiNested', '--all-comments'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK @@ -353,7 +355,8 @@ def test_show_service_with_all_comments(self): def test_show_service_with_no_comments(self): with self.launch_interface_command( - arguments=['show', 'ros2cli_test_msgs/srv/ShortVariedMultiNested', '--no-comments'] + arguments=[ + 'show', 'ros2cli_test_interfaces/srv/ShortVariedMultiNested', '--no-comments'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK @@ -373,7 +376,7 @@ def test_show_service_with_no_comments(self): def test_show_action(self): with self.launch_interface_command( - arguments=['show', 'ros2cli_test_msgs/action/ShortVariedMultiNested'] + arguments=['show', 'ros2cli_test_interfaces/action/ShortVariedMultiNested'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK @@ -399,7 +402,9 @@ def test_show_action(self): def test_show_action_with_all_comments(self): with self.launch_interface_command( arguments=[ - 'show', 'ros2cli_test_msgs/action/ShortVariedMultiNested', '--all-comments'] + 'show', + 'ros2cli_test_interfaces/action/ShortVariedMultiNested', + '--all-comments'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK @@ -432,7 +437,9 @@ def test_show_action_with_all_comments(self): def test_show_action_with_no_comments(self): with self.launch_interface_command( arguments=[ - 'show', 'ros2cli_test_msgs/action/ShortVariedMultiNested', '--no-comments'] + 'show', + 'ros2cli_test_interfaces/action/ShortVariedMultiNested', + '--no-comments'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == launch_testing.asserts.EXIT_OK @@ -466,7 +473,7 @@ def test_show_not_a_package(self): def test_show_not_an_interface(self): with self.launch_interface_command( - arguments=['show', 'ros2cli_test_msgs/msg/NotAMessageTypeName'] + arguments=['show', 'test_msgs/msg/NotAMessageTypeName'] ) as interface_command: assert interface_command.wait_for_shutdown(timeout=2) assert interface_command.exit_code == 1 From 3056860595d7cd0eae915e6eed276fb4e1ef4a65 Mon Sep 17 00:00:00 2001 From: Audrow Nash Date: Fri, 18 Dec 2020 21:12:08 -0800 Subject: [PATCH 6/7] Correct test interfaces dependency in package.xml Signed-off-by: Audrow Nash --- ros2cli/package.xml | 2 +- ros2interface/package.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ros2cli/package.xml b/ros2cli/package.xml index 1a3b5fe6f..500da2ba4 100644 --- a/ros2cli/package.xml +++ b/ros2cli/package.xml @@ -24,7 +24,7 @@ ament_pep257 ament_xmllint python3-pytest - ros2cli_test_msgs + ros2cli_test_interfaces test_msgs diff --git a/ros2interface/package.xml b/ros2interface/package.xml index 101c872a6..07e365550 100644 --- a/ros2interface/package.xml +++ b/ros2interface/package.xml @@ -24,7 +24,7 @@ ament_xmllint python3-pytest ros_testing - ros2cli_test_msgs + ros2cli_test_interfaces test_msgs From 0b1f6cb8056dc56eb4886748ac63d5f024931494 Mon Sep 17 00:00:00 2001 From: Audrow Nash Date: Wed, 23 Dec 2020 09:31:03 -0800 Subject: [PATCH 7/7] Remove ros2cli_test_interfaces from ros2cli test dependencies Signed-off-by: Audrow Nash --- ros2cli/package.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/ros2cli/package.xml b/ros2cli/package.xml index 500da2ba4..c815b0b12 100644 --- a/ros2cli/package.xml +++ b/ros2cli/package.xml @@ -24,7 +24,6 @@ ament_pep257 ament_xmllint python3-pytest - ros2cli_test_interfaces test_msgs