chktest.sh (477B)
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) | tee -a test.log 20 rm -f *.o 21 done < $file