Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add colcon test verb #19

Merged
merged 6 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions colcon_ros_cargo/task/ament_cargo/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ def _build_cmd(self, cargo_args):
'--quiet'
] + cargo_args

# Installation is done by cargo ament-build
def _install_cmd(self, cargo_args): # noqa: D102
pass


def write_cargo_config_toml(package_paths):
"""Write the resolved package paths to config.toml.
Expand Down
21 changes: 21 additions & 0 deletions colcon_ros_cargo/task/ament_cargo/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Licensed under the Apache License, Version 2.0

from colcon_cargo.task.cargo.test import CargoTestTask
from colcon_core.plugin_system import satisfies_version
from colcon_core.task import TaskExtensionPoint


class AmentCargoTestTask(CargoTestTask):
"""A test task for packages with Cargo.toml + package.xml.

Tests are already built by `colcon build` so this task only needs to
run them and doesn't need to worry about dependency management
(unlike the `AmentCargoBuildTask`).
"""

def __init__(self): # noqa: D107
super().__init__()
satisfies_version(TaskExtensionPoint.EXTENSION_POINT_VERSION, '^1.0')

def add_arguments(self, *, parser): # noqa: D102
pass
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ colcon_core.package_identification =
ament_cargo = colcon_ros_cargo.package_identification.ament_cargo:AmentCargoPackageIdentification
colcon_core.task.build =
ament_cargo = colcon_ros_cargo.task.ament_cargo.build:AmentCargoBuildTask
colcon_core.task.test =
ament_cargo = colcon_ros_cargo.task.ament_cargo.test:AmentCargoTestTask

[flake8]
import-order-style = google
Loading