shithub: scc

Download patch

ref: ebd513c2adeb9758701bf9f7a10b17ce58c2d1c8
parent: 4c6ff78ab23b4820161ec032390a88c7bd6b6fea
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sat Aug 25 13:28:29 EDT 2018

[tests] Remove unneeded use of cat

I know, I know. It was there for some old reason that is not valid
anymore.

--- a/tests/libc/execute/chktest.sh
+++ b/tests/libc/execute/chktest.sh
@@ -3,13 +3,12 @@
 file=${1?' empty input file'}
 
 ttyflags=`stty -g`
-trap "stty $ttyflags;tabs -8;rm -f a.out" 0 1 2 3 15
+#trap "stty $ttyflags;tabs -8;rm -f a.out" 0 1 2 3 15
 stty tabs
 tabs 40
 ulimit -c 0
 rm -f test.log
 
-cat $file |
 while read i state
 do
 	echo $i >>test.log
@@ -19,4 +18,4 @@
 
 	(./cc.sh $CFLAGS $i && ./a.out) 2>test.log &&
 	echo "[OK]" || echo "[FAILED]"
-done
+done < $file
--- a/tests/nm/execute/Makefile
+++ b/tests/nm/execute/Makefile
@@ -1,6 +1,5 @@
 .POSIX:
 
-PROJECTDIR=$$PWD/../../..
 ROOT=$(PROJECTDIR)/rootdir
 
 OUT = z80.out
--- a/tests/scc/error/Makefile
+++ b/tests/scc/error/Makefile
@@ -1,10 +1,11 @@
 .POSIX:
 
+ROOT=../../../rootdir
+
 all: tests
 
 tests:
-	CFLAGS='' SCCEXECPATH=../../bin PATH=../../bin:$$PATH ./chktest.sh < scc-tests.lst
+	@CFLAGS='' SCCPREFIX=$(ROOT) PATH=$(ROOT)/bin:$$PATH ./chktest.sh scc-tests.lst
 
 clean:
 	rm -f *.as *.o *.ir *.qbe *core test.log
-
--- a/tests/scc/error/chktest.sh
+++ b/tests/scc/error/chktest.sh
@@ -1,9 +1,11 @@
 #!/bin/sh
 
+file=${1?' empty input file'}
 err=/tmp/$$.err
 chk=/tmp/$$.chk
 
 trap "tabs -8;rm -f a.out *.o $chk $err" 0 1 2 3 15
+stty tabs
 tabs 40
 ulimit -c 0
 rm -f test.log
@@ -17,4 +19,4 @@
 	echo "/^PATTERN/+;/^\./-w $chk" | ed -s $i
 	diff -c $chk $err >> test.log  && echo [OK] || echo [FAILED]
 	rm -f *.o
-done
+done < $file
--- a/tests/scc/execute/chktest.sh
+++ b/tests/scc/execute/chktest.sh
@@ -8,7 +8,6 @@
 ulimit -c 0
 rm -f test.log
 
-cat $file |
 while read i state
 do
 	echo $i >>test.log
@@ -17,4 +16,4 @@
 	rm -f a.out
 	(scc -Isysinclude $CFLAGS "$i" && ./a.out) 2>test.log &&
 		echo "[OK]" || echo "[FAILED]"
-done
+done < $file