ref: 35d34bbbcae460ef8fbf579e090223ca22549b2d
parent: 529d80a36c7f5af3234619c8ba51f1c6a440fd9d
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Mon Mar 6 11:43:27 EST 2017
[tests] Improve Makefile infrastructure
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@
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/
--- /dev/null
+++ b/tests/Makefile
@@ -1,0 +1,4 @@
+
+all clean:
+ cd error && make -e $@
+ cd execute && make -e $@
--- a/tests/error/Makefile
+++ b/tests/error/Makefile
@@ -5,5 +5,5 @@
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
--- a/tests/error/chktest.sh
+++ b/tests/error/chktest.sh
@@ -6,9 +6,11 @@
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
--- a/tests/execute/Makefile
+++ b/tests/execute/Makefile
@@ -4,4 +4,4 @@
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
--- 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