fix a bug in computing line numbers
[asterisk/asterisk.git] / pbx / ael / ael-test / runtests
1 #!/bin/bash
2 ORIG=`mktemp /tmp/mytest.XXXXXX`
3 NEW=`mktemp /tmp/mytest.XXXXXX`
4 for i in ael-test*; do
5         echo -n Test: $i..................
6         (cd $i; ../../../../utils/aelparse -n -d | grep -v -i 'seconds' > ../res.$i)
7         sed 's/line:[0-9]*//; /^Executed.*/d' < res.$i > $NEW
8         sed 's/line:[0-9]*//; /^Executed.*/d' < ref.$i > $ORIG
9         if (diff -q $NEW $ORIG > /dev/null 2>&1 ) then
10                 echo PASSED
11                 rm res.$i
12         else
13                 echo %%%%%%FAILED%%%%%%
14                 diff -u ref.$i res.$i
15         fi
16
17 done
18 rm $NEW $ORIG