Skip to content

Commit

Permalink
Start and kill virtual iridium in test.sh (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
hhenry01 authored Nov 4, 2023
1 parent 62d21ba commit dfa1e3c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test.sh
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

0 comments on commit dfa1e3c

Please sign in to comment.