scc

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

commit cb0e4657c6c07681024481d68eff39b72c8f5963
parent 76df51d8984e56b5353000583a80b731c5e88330
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sun, 19 Jan 2020 12:00:01 +0100

tests-libc: Create tests-amd64 and tests-i386

Having custom modifications for every contributor was
creating problems. This patch fixed the problems adding
different targets for amd64 and for i386. By default
both are tested.

Diffstat:
Atests/libc/execute/.gitignore | 38++++++++++++++++++++++++++++++++++++++
Mtests/libc/execute/Makefile | 9++++++---
Mtests/libc/execute/chktest.sh | 6+++---
Mtests/libc/execute/libc-tests.lst | 3+--
4 files changed, 48 insertions(+), 8 deletions(-)

diff --git a/tests/libc/execute/.gitignore b/tests/libc/execute/.gitignore @@ -0,0 +1,38 @@ +0001-abort +0002-assert +0003-assert +0004-abort +0005-ctype +0006-limits +0007-signal +0008-longjmp +0009-stdarg +0010-stddef +0011-strcat +0012-strchr +0013-strcmp +0014-strcoll +0015-strcpy +0016-strcspn +0017-strerror +0018-strlen +0019-strncat +0020-strncmp +0021-strncpy +0022-strnlen +0023-strpbrk +0024-strrchr +0025-strspn +0026-strstr +0027-strtok +0028-strxfrm +0029-memchr +0030-memcpy +0031-memmove +0032-memset +0033-memcmp +0034-errno +0035-setlocale +0036-localeconv +0037-malloc +test.log diff --git a/tests/libc/execute/Makefile b/tests/libc/execute/Makefile @@ -7,10 +7,13 @@ CC = SCCPREFIX=$(ROOT) ./cc.sh .c: $(CC) $(CFLAGS) -o $@ $< -all: tests +all: tests-i386 tests-amd64 -tests: - @SCCPREFIX=$(ROOT) ./chktest.sh libc-tests.lst +tests-i386: + @SCCPREFIX=$(ROOT) CFLAGS='-a i386' ./chktest.sh libc-tests.lst + +tests-amd64: + @SCCPREFIX=$(ROOT) CFLAGS='-a amd64' ./chktest.sh libc-tests.lst clean: rm -f *.o *core test.log `awk '{print $$1}' libc-tests.lst` diff --git a/tests/libc/execute/chktest.sh b/tests/libc/execute/chktest.sh @@ -3,8 +3,7 @@ file=${1?' empty input file'} tmp1=`mktemp` tmp2=`mktemp` -bins=`awk '{print $1}' libc-tests.lst` -trap "rm -f *.o $bins $tmp1 $tmp2; exit" 0 1 2 3 15 +trap "rm -f *.o $tmp1 $tmp2" EXIT INT QUIT TERM ulimit -c 0 rm -f test.log @@ -16,8 +15,9 @@ do (echo $i ./cc.sh $CFLAGS -o $i $i.c echo '/^output:$/+;/^end:$/-'w $tmp1 | ed -s $i.c - ./$i > $tmp2 + ./$i > $tmp2 2>> test.log diff -u $tmp1 $tmp2) >> test.log 2>&1 && + printf '[PASS]' || printf '[FAIL]' printf "$state\t%s\n" $i done < $file diff --git a/tests/libc/execute/libc-tests.lst b/tests/libc/execute/libc-tests.lst @@ -34,5 +34,4 @@ 0034-errno 0035-setlocale 0036-localeconv -0037-time -0038-malloc [TODO] +0037-malloc [TODO]