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'}
 4err=/tmp/$$.err
 5chk=/tmp/$$.chk
 6
 7trap 'rm -f a.out *.o $chk $err; exit' EXIT HUP INT TERM
 8ulimit -c 0
 9rm -f test.log
10
11while read i state
12do
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 -u $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
21done < $file