shithub: scc

Download patch

ref: 0194c75a6ebde28e00a49cae718c6675758326d4
parent: b3ac093c1354d52c062b70d3efe60e17dafb5f54
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Wed Feb 14 18:03:04 EST 2018

[test] Don't use redirection if you use stty

Stty and tabs cannot work with a redirect input, what do you
expect?

--- a/tests/execute/Makefile
+++ b/tests/execute/Makefile
@@ -3,7 +3,7 @@
 all: tests
 
 tests:
-	CFLAGS='' SCCPREFIX=../../rootdir/ PATH=../../rootdir/bin:$$PATH ./chktest.sh < scc-tests.lst
+	CFLAGS='' SCCPREFIX=../../rootdir/ PATH=../../rootdir/bin:$$PATH ./chktest.sh scc-tests.lst
 
 clean:
 	rm -f *.as *.o *.ir *.qbe *core test.log
--- a/tests/execute/chktest.sh
+++ b/tests/execute/chktest.sh
@@ -1,5 +1,6 @@
 #!/bin/sh
 
+file=${1?' empty input file'}
 ttyflags=`stty -g`
 trap "stty $ttyflags;tabs -8;rm -f a.out; exit 1" 0 1 2 3 15
 stty tabs
@@ -7,6 +8,7 @@
 ulimit -c 0
 rm -f test.log
 
+cat $file |
 while read i state
 do
 	echo $i >>test.log