--- /dev/null
+#!/bin/sh
+
+beispiel=parser
+allow_null_glob_expansion=1
+shopt -s nullglob
+PROGRAM=./$beispiel
+errnum=0
+prgnum=0
+
+LOC=~/abgabe/$beispiel/test
+
+for i in $LOC/*.[012]
+do
+ echo "---------------------------------------------------------------------"
+ echo "Test file: $i"
+ echo "Input:"
+ echo "======"
+ echo
+ cat $i
+ echo
+ let prgnum=prgnum+1
+ $PROGRAM <$i >/dev/null 2>/dev/null
+ retval=$?
+ if test $retval -eq ${i##*.}
+ then
+ echo "Correct exit status."
+ else
+ echo "[Error] Status is $retval but ${i##*.} was expected!"
+ echo
+ let errnum=errnum+1
+ fi
+done
+echo "---------------------------------------------------------------------"
+echo
+let corrnum=prgnum-errnum
+echo "Statistics:"
+echo "==========="
+echo " $prgnum Tests total"
+echo " $corrnum Tests passed"
+echo " $errnum Tests failed"
clean:
rm -f $(PARSER){,.o,.c,.h,.output} $(SCANNER).{c,o}
+1test: clean $(NAME)
+ @./09test.sh
+
2test:
/usr/ftp/pub/ublu/test/$(NAME)/test 2>&1