scc

A fork of https://git.simple-cc.org/scc/ for Qute

git clone https://git.8pit.net/scc.git

 1#!/bin/sh
 2
 3file=${1?' empty input file'}
 4
 5trap 'rm -f *.o  $tmp1 $tmp2' EXIT
 6trap 'exit $?' INT QUIT TERM
 7
 8rm -f test.log
 9
10tmp1=tmp1.$$
11tmp2=tmp2.$$
12
13while read i state
14do
15	rm -f *.o $i $tmp1 $tmp2
16
17	(echo $i
18	 ${MAKE-make} -s $i
19	 echo '/^output:$/+;/^end:$/-'w $tmp1 | ed -s $i.c
20
21	 timeout 30 $EXEC ./$i >$tmp2 2>&1
22
23	 if grep '^RESULT: SKIP$' $tmp2
24	 then
25		printf '\tSKIP\t%s\n' $i $state
26		continue
27	 fi
28	 diff -u $tmp1 $tmp2) >> test.log 2>&1 &&
29
30	printf '[PASS]' || printf '[FAIL]'
31        printf '\t%s\t%s\n' $i $state
32done < $file