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 as ct #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ Zsh:
| `colcon build --symlink-install` | `cb` |
| `colcon build --symlink-install --packages-select` | `cbp`| package 1 [Optional] ... package n [Optional] |
| `colcon build --symlink-install --packages-skip` | `cbs`| package 1 [Optional] ... package n [Optional] |
| `colcon test` | `ct` |
| `colcon test --packages-select` | `ctp`| package 1 [Optional] ... package n [Optional] |
| `colcon test --packages-skip` | `cts`| package 1 [Optional] ... package n [Optional] |
| `colcon list` | `cl` |

## Rosdep
Expand Down
36 changes: 36 additions & 0 deletions ros2_utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,42 @@ function cbs {
history -s $CMD
}

function ct {
CMD="colcon test"
echo $CMD
$CMD
history -s ct $@
history -s $CMD
}

function ctp {
if [ $# -eq 0 ]; then
PACKAGE=$(colcon list -n | fzf)
[[ -z "$PACKAGE" ]] && return
local CMD="colcon test --packages-select $PACKAGE"
else
local CMD="colcon test --packages-select $@"
fi
echo $CMD
$CMD
history -s ctp $@
history -s $CMD
}

function cts {
if [ $# -eq 0 ]; then
PACKAGE=$(colcon list -n | fzf)
[[ -z "$PACKAGE" ]] && return
local CMD="colcon test --packages-skip $PACKAGE"
else
local CMD="colcon test --packages-skip $@"
fi
echo $CMD
$CMD
history -s cts $@
history -s $CMD
}

function cl {
CMD="colcon list -n"
echo $CMD
Expand Down
36 changes: 36 additions & 0 deletions ros2_utils.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,42 @@ function cbs {
print -s $CMD
}

function ct {
CMD=(colcon test)
echo $CMD
$CMD
print -s ct
print -s $CMD
}

function ctp {
if [ $# -eq 0 ]; then
PACKAGE=$(colcon list -n | fzf)
[[ -z "$PACKAGE" ]] && return
CMD="colcon test --packages-select $PACKAGE"
else
CMD="colcon test --packages-select $@"
fi
echo $CMD
eval $CMD
print -s ctp $@
print -s $CMD
}

function cts {
if [ $# -eq 0 ]; then
PACKAGE=$(colcon list -n | fzf)
[[ -z "$PACKAGE" ]] && return
CMD="colcon test --packages-skip $PACKAGE"
else
CMD="colcon test --packages-skip $@"
fi
echo $CMD
eval $CMD
print -s cts $@
print -s $CMD
}

function cl {
CMD=(colcon list -n)
echo $CMD
Expand Down