altos/test: Add scripts to run lots of flights through the code
[fw/altos] / src / test / run-tests
1 #!/bin/sh
2
3 DIR=~/src/cc1111/flights
4
5 while read flight; do
6         baro=`./ao_flight_test_baro -s $DIR/$flight |
7                 awk '/drogue/ { printf "%s ", $4 }
8                 /main/ { printf "%s\n", $4 }'`
9         full=`./ao_flight_test -s $DIR/$flight |
10                 awk '/drogue/ { printf "%s ", $4 }
11                 /main/ { printf "%s\n", $4 }'`
12         echo $flight $baro $full
13 done < test-flights |
14 awk '{ name = $1;
15         drogue_error = $2 - $4;
16         if (drogue_error < 0) drogue_error = -drogue_error;
17         main_error = $3 - $5;
18         if (main_error < 0) main_error = -main_error;
19         if (drogue_error > 4 || main_error > 4)
20                 printf ("%s: baro drogue %f main %f. full drogue %f main %f\n",
21                         name, $2, $3, $4, $5);
22         }'