Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Npaintrobo committed Jan 4, 2024
1 parent 5289bae commit f7498e9
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions test/test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
dir=~
[ "$1" != "" ] && dir="$1"

cd "$dir/ros2_ws"
cd $dir/ros2_ws
colcon build
source "$dir/.bashrc"
source $dir/.bashrc

ng() {
echo "NG at Line $1"
Expand All @@ -16,28 +16,19 @@ ng() {

res=0

parrot_log=$(mktemp)

# Parrot-node
(ros2 run robosys2023ros parrot > "$parrot_log" 2>&1)&

(ros2 run robosys2023ros parrot > /tmp/mypkg.log 2>&1)&
# Human-node
{
(sleep 4 ; echo "aiueo"; sleep 1; echo "123456789"; sleep 1; echo "a1b2c3d4e5") | ros2 run robosys2023ros human
}

sleep 20

echo "Parrot Log Content:"
cat "$parrot_log"


# Check Parrot-log
cat "$parrot_log" | grep 'aiueo' || ng ${LINENO}
cat "$parrot_log" | grep '123456789' || ng ${LINENO}
cat "$parrot_log" | grep 'a1b2c3d4e5' || ng ${LINENO}

rm "$parrot_log"
# Parrot-log
cat /tmp/mypkg.log | grep 'aiueo' || ng ${LINENO}
cat /tmp/mypkg.log | grep '123456789' || ng ${LINENO}
cat /tmp/mypkg.log | grep 'a1b2c3d4e5' || ng ${LINENO}

echo ""
[ "$res" = 0 ] && echo "OK"
Expand Down

0 comments on commit f7498e9

Please sign in to comment.