tests/syntax/identifier/runtests
changeset 108 f9e001952488
child 258 d7d92b2f87e9
equal deleted inserted replaced
107:ff5c92df0c78 108:f9e001952488
       
     1 #!/bin/bash
       
     2 
       
     3 # assume no error to start with...
       
     4 error=0
       
     5 
       
     6 for ff in `ls *.test`
       
     7 do
       
     8   for id in `cat $ff | grep "^#" | sed "s/#[^ ]*//g"`
       
     9   do
       
    10 	sed s/XXXX/$id/g $ff > $ff"_"$id.iec
       
    11 	if `../../../iec2iec $ff"_"$id.iec -I ../../../lib > $ff"_"$id.out 2>$ff"_"$id.err`
       
    12 		# TODO before deciding test is success [OK]
       
    13 		#       - test whether xxx.out has size <> 0
       
    14 		#       - test whether xxx.err has size == 0
       
    15 		#       - (?) test whether xxx.out2 is identical to xxx.out
       
    16 		#       - (?) test whether xxx.err2 has size == 0
       
    17 		#       - perhaps produce a [WARN] instead of [ERROR] in cases of (?)
       
    18 	  then echo "[ O K ]   " $ff "->" $id
       
    19 	  else echo "[ERROR]   " $ff "->" $id; error=1
       
    20 	fi
       
    21 #	../../../iec2iec $ff"_"$id.out -I ../../../lib > $ff"_"$id.out2 2>$ff"_"$id.err2
       
    22   done
       
    23 done
       
    24 
       
    25 echo
       
    26 if `test $error = 1`
       
    27   then echo "FAILURE -> At least one of the tests failed!"
       
    28   else echo "SUCCESS -> All tests passed!"
       
    29 fi