1#!/bin/sh23file=${1?' empty input file'}45trap 'rm -f *.o $tmp1 $tmp2' EXIT6trap 'exit $?' INT QUIT TERM78rm -f test.log910tmp1=tmp1.$$11tmp2=tmp2.$$1213while read i state14do15 rm -f *.o $i $tmp1 $tmp21617 (echo $i18 ${MAKE-make} -s $i19 echo '/^output:$/+;/^end:$/-'w $tmp1 | ed -s $i.c2021 timeout 30 $EXEC ./$i >$tmp2 2>&12223 if grep '^RESULT: SKIP$' $tmp224 then25 printf '\tSKIP\t%s\n' $i $state26 continue27 fi28 diff -u $tmp1 $tmp2) >> test.log 2>&1 &&2930 printf '[PASS]' || printf '[FAIL]'31 printf '\t%s\t%s\n' $i $state32done < $file