Skip to content

Commit

Permalink
Add smoke test for CLI extension (#132)
Browse files Browse the repository at this point in the history
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
  • Loading branch information
hidmic committed Jun 7, 2021
1 parent d68c385 commit a43ba5d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rosidl_generator_py/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ if(BUILD_TESTING)
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/rosidl_generator_py"
)
endif()

ament_add_pytest_test(test_cli_extension test/test_cli_extension.py)
endif()

ament_package(
Expand Down
28 changes: 28 additions & 0 deletions rosidl_generator_py/test/test_cli_extension.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2021 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import pathlib

from rosidl_cli.command.generate.api import generate

PACKAGE_DIR = str(pathlib.Path(__file__).parent.parent)


def test_cli_extension_for_smoke(tmp_path):
generate(
package_name='rosidl_generator_py',
interface_files=[PACKAGE_DIR + ':msg/StringArrays.msg'],
types=['py'],
output_path=tmp_path
)

0 comments on commit a43ba5d

Please sign in to comment.