scanner: georg.sh cleanup
authorGeorg Schiesser <e0307201@student.tuwien.ac.at>
Wed, 31 Mar 2010 22:58:15 +0000 (00:58 +0200)
committerGeorg Schiesser <e0307201@student.tuwien.ac.at>
Wed, 31 Mar 2010 22:58:15 +0000 (00:58 +0200)
scanner/georg.sh

index df54ed1a4071a66814ff69eb6060b9b60aa8a346..67f6b37a8e1a820303e61ad97da0a73cd04fcd03 100755 (executable)
@@ -3,16 +3,29 @@
 TCG=./georg_testcase-generator.sh
 DIR=~/abgabe/scanner
 ELF=~/abgabe/scanner/scanner
+LOC=/usr/ftp/pub/ubvl/test/scanner
 
-make -C $DIR/
+if ! make -C $DIR/
+then
+       echo >&2 "ERROR: make failed"
+       exit 1
+fi
 
 while read DIGITS i
 do
-       PROGRAM=$ELF DIGITS=$DIGITS $TCG $i > /dev/null
-
+       # generate testcases using charset in hex
+       if ! PROGRAM=$ELF DIGITS=$DIGITS $TCG $i > /dev/null
+       then
+               echo >&2 "ERROR: TCG failed"
+               rm -f $i.*.*
+               exit 1
+       fi
+
+       # positive tests only
        mv -f $i.0.0 georg_$i.0
        mv -f $i.0.1 georg_$i.out
 
+       # cleanup
        rm -f $i.*.*
 
 done << EOF
@@ -22,13 +35,15 @@ done << EOF
 4      $(echo -ne ' 0x1'       | xxd -ps)
 2      $(echo -ne ' \t\r\f\b'  | xxd -ps)
 EOF
+# skip that below
 cat > /dev/null << EOF
 3      $(echo -ne '0123'       | xxd -ps)
 6      $(echo -ne ' if39'      | xxd -ps)
 7      $(echo -ne ' if0x1'     | xxd -ps)
 EOF
 
-/usr/ftp/pub/ublu/test/scanner/test 2>&1
+# testbench
+$LOC/test 2>&1
 
 ## Georg Schiesser <e0307201/AT/student.tuwien.ac.at> @ UBVL 2010S # GPLv2
 ## vim: filetype=sh shiftwidth=8 tabstop=8 noexpandtab nopaste: