generated from athackst/vscode_ros2_workspace
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start and kill virtual iridium in test.sh (#187)
- Loading branch information
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
function signal_handler() { | ||
if [ -n "$(pgrep -f virtual_iridium)" ]; then | ||
pkill -f virtual_iridium | ||
fi | ||
} | ||
|
||
# Test failures terminate the script | ||
# Catch the signal so child processes can be cleaned up | ||
trap 'exit' INT TERM | ||
trap 'signal_handler' EXIT | ||
|
||
if [ -f install/local_setup.bash ]; then source install/local_setup.bash; fi | ||
if [ -d src/network_systems ]; then src/network_systems/scripts/run_virtual_iridium.sh &> /dev/null & fi | ||
colcon test --packages-ignore virtual_iridium --merge-install --event-handlers console_cohesion+ | ||
colcon test-result | ||
exit 0 |