scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

chktest.sh (417B)


      1 #!/bin/sh
      2 
      3 file=${1?' empty input file'}
      4 err=/tmp/$$.err
      5 chk=/tmp/$$.chk
      6 
      7 trap "rm -f a.out *.o $chk $err; exit" 0 1 2 3 15
      8 ulimit -c 0
      9 rm -f test.log
     10 
     11 while read i state
     12 do
     13 	echo $i >> test.log
     14 	state=${state:-"\t"}
     15 
     16 	scc $CFLAGS -w -c $i 2> $err
     17 	echo "/^PATTERN/+;/^\./-w $chk" | ed -s $i
     18 	diff -c $chk $err >> test.log  && printf '[PASS]' || echo '[FAIL]'
     19 	printf "%s\t%s\n" "$state" "$i"
     20 	rm -f *.o
     21 done < $file