scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit 2fcf0e895e2bd5f1676f492af4b1ad4a772a2171
parent 6cf29c17ac9d7e4a35272b60dd86f200be33389e
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon,  7 Oct 2019 22:03:06 +0200

[tests] Update shell scripts to new cc name and dir layout

Diffstat:
Mtests/ar/execute/Makefile | 2+-
Mtests/cc/error/Makefile | 6++++--
Mtests/cc/error/chktest.sh | 10+++++-----
Mtests/cc/error/update.sh | 2+-
Mtests/cc/execute/Makefile | 4+++-
Mtests/cc/execute/chktest.sh | 2+-
6 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/tests/ar/execute/Makefile b/tests/ar/execute/Makefile @@ -5,7 +5,7 @@ ROOT=../../.. all: tests tests: master.a - @TZ=UTC PATH=$(ROOT)/bin:$$PATH chktest.sh + @TZ=UTC PATH=$(ROOT)/bin:$$PATH ./chktest.sh master.a: ./mkmaster.sh diff --git a/tests/cc/error/Makefile b/tests/cc/error/Makefile @@ -1,11 +1,13 @@ .POSIX: -ROOT=../../../root +ROOT=../../.. +SCCPREFIX=$(ROOT) +CC=$(ROOT)/bin/cc all: tests tests: - @CFLAGS='' SCCPREFIX=$(ROOT) PATH=$(ROOT)/bin:$$PATH chktest.sh scc-tests.lst + CC=$(CC) SCCPREFIX=$(SCCPREFIX) ./chktest.sh scc-tests.lst clean: rm -f *.as *.o *.ir *.qbe *core test.log diff --git a/tests/cc/error/chktest.sh b/tests/cc/error/chktest.sh @@ -11,11 +11,11 @@ rm -f test.log while read i state do echo $i >> test.log - state=${state:-"\t"} + state=${state:-""} - scc $CFLAGS -w -c $i 2> $err - echo "/^PATTERN/+;/^\./-w $chk" | ed -s $i - diff -c $chk $err >> test.log && printf '[PASS]' || echo '[FAIL]' - printf "%s\t%s\n" "$state" "$i" + (SCCPREFIX=$SCCPREFIX $CC $CFLAGS -w -c $i) 2> $err + (echo "/^PATTERN/+;/^\./-w $chk" | ed -s $i) >/dev/null 2>&1 + diff -c $chk $err >> test.log && printf '[PASS]' || printf '[FAIL]' + printf "\t%s\t%s\n" $i $state rm -f *.o done < $file diff --git a/tests/cc/error/update.sh b/tests/cc/error/update.sh @@ -3,7 +3,7 @@ for i do (echo '/^PATTERN/+;/^\./-c' - scc $CFLAGS -w -c $i 2>&1 + cc $CFLAGS -w -c $i 2>&1 printf ".\nw\n" echo w) | ed -s $i diff --git a/tests/cc/execute/Makefile b/tests/cc/execute/Makefile @@ -1,11 +1,13 @@ .POSIX: ROOT=../../.. +SCCPREFIX=$(ROOT) +CC=$(ROOT)/bin/cc all: tests tests: - @CFLAGS='' SCCPREFIX=$(ROOT) PATH=$(ROOT)/bin:$$PATH ./chktest.sh scc-tests.lst + @CC=$(CC) SCCPREFIX=$(SCCPREFIX) ./chktest.sh scc-tests.lst clean: rm -f *.as *.o *.ir *.qbe *core test.log diff --git a/tests/cc/execute/chktest.sh b/tests/cc/execute/chktest.sh @@ -18,7 +18,7 @@ do state=${state:-""} rm -f a.out - (scc -Isysinclude $CFLAGS "$i" && ./a.out) 2>>test.log && + (SCCPREFIX=$SCCPREFIX $CC -Isysinclude $CFLAGS "$i" && ./a.out) 2>>test.log && printf '[PASS]' || printf '[FAIL]' printf '\t%s\t%s\n' $i $state done < $file