scc

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

commit ec8f82c9f549565ab4efa20b9d85b249a194f099
parent 0ce2c994978533590d4c061bddc5ebf56b26f94a
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon,  6 Mar 2017 16:43:27 +0100

[tests] Improve Makefile infrastructure

Diffstat:
MMakefile | 2+-
Atests/Makefile | 4++++
Mtests/error/Makefile | 2+-
Mtests/error/chktest.sh | 2++
Mtests/execute/Makefile | 2+-
Mtests/execute/chktest.sh | 4+++-
6 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile @@ -33,7 +33,7 @@ libc: libc/src/libc.a cd libc/src && $(MAKE) -e CC=scc tests: all - cd tests/execute && $(MAKE) -e tests + cd tests && $(MAKE) -e all install: all mkdir -p $(DESTDIR)/$(PREFIX)/libexec/scc/ diff --git a/tests/Makefile b/tests/Makefile @@ -0,0 +1,4 @@ + +all clean: + cd error && make -e $@ + cd execute && make -e $@ diff --git a/tests/error/Makefile b/tests/error/Makefile @@ -5,5 +5,5 @@ tests: CFLAGS='' SCCEXECPATH=../../bin PATH=../../bin:$$PATH ./chktest.sh < scc-tests.lst clean: - rm -f *.as *.o *.ir *.qbe *core + rm -f *.as *.o *.ir *.qbe *core test.log diff --git a/tests/error/chktest.sh b/tests/error/chktest.sh @@ -6,9 +6,11 @@ chk=/tmp/$$.chk trap "tabs -8;rm -f a.out *.o $err" 0 1 2 3 15 tabs 40 ulimit -c 0 +rm -f test.log while read i state do + echo $i >> test.log printf "%s\t" $i printf "%s" $state diff --git a/tests/execute/Makefile b/tests/execute/Makefile @@ -4,4 +4,4 @@ all: tests tests: CFLAGS='' SCCEXECPATH=../../bin PATH=../../bin:$$PATH ./chktest.sh < scc-tests.lst clean: - rm -f *.as *.o *.ir *.qbe *core + rm -f *.as *.o *.ir *.qbe *core test.log diff --git a/tests/execute/chktest.sh b/tests/execute/chktest.sh @@ -3,12 +3,14 @@ trap 'tabs -8;rm -f a.out' 0 1 2 3 15 tabs 40 ulimit -c 0 +rm -f test.log while read i state do + echo $i >>test.log printf "%s\t" $i printf "%s" $state rm -f a.out - (scc -Isysinclude $CFLAGS "$i" && ./a.out) 2>/dev/null && + (scc -Isysinclude $CFLAGS "$i" && ./a.out) 2>test.log && echo [OK] || echo [FAILED] done