ref: 045dd2bcc4b996cc2543646b612e28e7fa31b47a
parent: a2e3a665294b6d10575f0108a5ec56ead724ae17
author: Quentin Rameau <quinq@fifth.space>
date: Sun Aug 26 06:04:36 EDT 2018
[tests] change output format: [state]: file This simplifies the scripts, there is no need to manage tabulation. Also, this lets sacc work on OpenBSD which doesn't provide tabs(1).
--- a/tests/ar/execute/chktest.sh
+++ b/tests/ar/execute/chktest.sh
@@ -1,9 +1,6 @@
#!/bin/sh
-ttyflags=`stty -g`
-trap "stty $ttyflags;tabs -8;rm -rf file*" 0 2 3 15
-stty tabs
-tabs 40
+trap "rm -rf file*" 0 2 3 15
ulimit -c 0
rm -f test.log
rm -rf file*
@@ -11,6 +8,6 @@
for i in *-*.sh
do
printf "Test: %s\n\n" $i >> test.log
- printf "%s\t" $i
- ./$i >> test.log 2>&1 && echo [OK] || echo [FAIL]
+ ./$i >> test.log 2>&1 && printf '[PASS]: ' || printf '[FAIL]: '
+ echo "$i"
done
--- a/tests/as/execute/chktest.sh
+++ b/tests/as/execute/chktest.sh
@@ -1,8 +1,5 @@
#!/bin/sh
-ttyflags=`stty -g`
-trap "stty $ttyflags; tabs -8" 0 2 3 15
-stty tabs
ulimit -c 0
rm -f test.log
@@ -10,6 +7,6 @@
do
cpu="${i%.s}"
printf "Test: %s\n\n" $cpu >> test.log
- printf " Testing cpu=%s\t" $cpu
- ./test.sh $cpu && echo [OK] || echo [FAIL]
+ ./test.sh $cpu && printf '[PASS]: ' || printf '[FAIL]: '
+ printf 'testing cpu=%s\n' "$cpu"
done
--- a/tests/libc/execute/chktest.sh
+++ b/tests/libc/execute/chktest.sh
@@ -1,11 +1,7 @@
#!/bin/sh
file=${1?' empty input file'}
-
-ttyflags=`stty -g`
-#trap "stty $ttyflags;tabs -8;rm -f a.out" 0 1 2 3 15
-stty tabs
-tabs 40
+trap "rm -f a.out" 0 1 2 3 15
ulimit -c 0
rm -f test.log
@@ -12,10 +8,9 @@
while read i state
do
echo $i >>test.log
- printf "%s\t" $i
- printf "%s" $state
rm -f a.out
(./cc.sh $CFLAGS $i && ./a.out) 2>test.log &&
- echo "[OK]" || echo "[FAILED]"
+ printf '[PASS]' || printf '[FAIL]'
+ printf '%s: %s\n' "$state" "$i"
done < $file
--- a/tests/nm/execute/chktest.sh
+++ b/tests/nm/execute/chktest.sh
@@ -1,16 +1,12 @@
-#!/bin//sh
+#!/bin/sh
-ttyflags=`stty -g`
-trap "stty $ttyflags;tabs -8; rm -f a.out" 0 2 3 15
-stty tabs
-tabs 40
+trap "rm -f a.out" 0 2 3 15
ulimit -c 0
rm -f test.log
-
for i in *-*.sh
do
printf "Test: %s\n\n" $i >> test.log
- printf "%s\t" $i
- ./$i >> test.log 2>&1 && echo [OK] || echo [FAIL]
+ ./$i >> test.log 2>&1 && printf '[PASS]: ' || printf '[FAIL]: '
+ echo "$i"
done
--- a/tests/scc/error/chktest.sh
+++ b/tests/scc/error/chktest.sh
@@ -4,9 +4,7 @@
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
+trap "rm -f a.out *.o $chk $err" 0 1 2 3 15
ulimit -c 0
rm -f test.log
@@ -13,10 +11,10 @@
while read i state
do
echo $i >> test.log
- printf "%s\t%s" $i $state
scc $CFLAGS -w -c $i 2> $err
echo "/^PATTERN/+;/^\./-w $chk" | ed -s $i
- diff -c $chk $err >> test.log && echo [OK] || echo [FAILED]
+ diff -c $chk $err >> test.log && printf '[PASS]' || echo '[FAIL]'
+ printf "%s: %s\n" "$state" "$i"
rm -f *.o
done < $file
--- a/tests/scc/execute/chktest.sh
+++ b/tests/scc/execute/chktest.sh
@@ -1,10 +1,7 @@
#!/bin/sh
file=${1?' empty input file'}
-ttyflags=`stty -g`
-trap "stty $ttyflags;tabs -8;rm -f a.out" 0 1 2 3 15
-stty tabs
-tabs 40
+trap "rm -f a.out" 0 1 2 3 15
ulimit -c 0
rm -f test.log
@@ -18,10 +15,9 @@
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>>test.log &&
- echo "[OK]" || echo "[FAILED]"
+ printf '[PASS]' || printf '[FAIL]'
+ printf '%s: %s\n' "$state" "$i"
done < $file