scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 14474dfd1a3b9a3912b4b73980ed6dad1f604576
parent 9bf16fdaec39d2cde807c8408532f9535e29652e
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 24 Nov 2015 15:08:06 +0100

Simplify cc1/tests/chktest.sh

Diffstat:
Mcc1/tests/chktest.sh | 42++++++++++++++----------------------------
1 file changed, 14 insertions(+), 28 deletions(-)

diff --git a/cc1/tests/chktest.sh b/cc1/tests/chktest.sh @@ -2,37 +2,23 @@ out=/tmp/$$.out chk=/tmp/$$.chk -err=test.log trap "rm -f $out $chk" EXIT INT QUIT HUP -rm -f $err +rm -f test.log for i in *.c do - awk ' - BEGIN { - out="'$out'" - chk="'$chk'" - err="'$err'" - test="'$i'" - system("rm -f " out " " chk) - } - /^name:/ { - printf "Running %s ", $2 - } - /^output:$/ { - copyon=1 - } - /^\*\// { - copyon=0 - } - copyon==1 && !/^output:$/ { - print $0 >> chk - } - END { - system("../cc1 -I. -w " test " > " out " 2>&1") - cmd="diff -c " chk " " out " >> " err - print test >> err - print system(cmd) ? "[FAILED]" : "[OK]" - }' $i + rm -f $out $chk + awk '/^name:/ {printf "Running %s ", $2} + /^output:$/ {copyon=1; next} + /^\*\// {copyon=0; next} + copyon==1 {print > "'$chk'"}' $i + + ../cc1 -I. -w $i > $out 2>&1 + if diff -c $chk $out >> test.log + then + echo [OK] + else + echo [FAILED] + fi done