scc

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

chktest.sh (456B)


      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:-""}
     15 
     16 	(SCCPREFIX=$SCCPREFIX $CC $CFLAGS -w -c $i) 2> $err
     17 	(echo "/^PATTERN/+;/^\./-w $chk" | ed -s $i) >/dev/null 2>&1
     18 	diff -c $chk $err >> test.log  && printf '[PASS]' || printf '[FAIL]'
     19 	printf "\t%s\t%s\n" $i $state
     20 	rm -f *.o
     21 done < $file