From 9a8fec1b6d8f3346f988882ffb03d7d0e45b3c81 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 14 Apr 2012 12:00:32 -0700 Subject: [PATCH] altos: Clean up test scripts The flight test scripts were using invalid bash syntax. Clean that up and also switch the default flight directory to my new ~/misc/rockets/flights directory. Signed-off-by: Keith Packard --- src/test/run-one | 16 +++++++++++++--- src/test/run-tests | 10 +++++----- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/test/run-one b/src/test/run-one index 7d0f95ae..8fa0787c 100755 --- a/src/test/run-one +++ b/src/test/run-one @@ -1,10 +1,20 @@ #!/bin/sh +DIR=~/misc/rockets/flights + for i in "$@"; do -./ao_flight_test "$i" > run-out.full -./ao_flight_test_baro "$i" > run-out.baro +case "$i" in + */*) + file="$i" + ;; + *) + file="$DIR/$i" + ;; +esac +./ao_flight_test "$file" > run-out.full +./ao_flight_test_baro "$file" > run-out.baro -#./ao_flight_test_accel "$i" > run-out.accel +#./ao_flight_test_accel "$file" > run-out.accel #"run-out.accel" using 1:9 with lines lt 4 axes x1y1 title "accel height",\ #"run-out.accel" using 1:11 with lines lt 4 axes x1y2 title "accel speed",\ #"run-out.accel" using 1:13 with lines lt 4 axes x1y2 title "accel accel",\ diff --git a/src/test/run-tests b/src/test/run-tests index 3e0cad3c..a8a8dc3f 100755 --- a/src/test/run-tests +++ b/src/test/run-tests @@ -1,6 +1,6 @@ -#!/bin/sh +#!/bin/bash -DIR=~/src/cc1111/flights +DIR=~/misc/rockets/flights bad_baro=0 bad_full=0 @@ -8,15 +8,15 @@ while read flight description; do if ./ao_flight_test_baro -s $DIR/$flight; then : else - ((bad_baro++)) + : $((bad_baro++)) fi if ./ao_flight_test -s $DIR/$flight; then : else - ((bad_full++)) + : $((bad_full++)) fi done < test-flights echo baro errors $bad_baro echo full errors $bad_full -((bad = bad_baro + bad_full)) +: $((bad = bad_baro + bad_full)) exit $bad \ No newline at end of file -- 2.30.2