[hackers] [scc] Simplify cc1/tests/chktest.sh || Roberto E. Vargas Caballero
commit 14474dfd1a3b9a3912b4b73980ed6dad1f604576
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Tue Nov 24 15:08:06 2015 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Tue Nov 24 15:08:06 2015 +0100
Simplify cc1/tests/chktest.sh
diff --git a/cc1/tests/chktest.sh b/cc1/tests/chktest.sh
index bbf34ce..71222c8 100755
--- a/cc1/tests/chktest.sh
+++ b/cc1/tests/chktest.sh
_AT_@ -2,37 +2,23 @@
out=/tmp/$$.out
chk=/tmp/$$.chk
-err=test.log
trap "rm -f $out $chk" EXIT INT QUIT HUP
-rm -f $err
+rm -f test.log
for i in *.c
do
- awk '
- BEGIN {
- out="'$out'"
- chk="'$chk'"
- err="'$err'"
- test="'$i'"
- system("rm -f " out " " chk)
- }
- /^name:/ {
- printf "Running %s ", $2
- }
- /^output:$/ {
- copyon=1
- }
- /^\*\// {
- copyon=0
- }
- copyon==1 && !/^output:$/ {
- print $0 >> chk
- }
- END {
- system("../cc1 -I. -w " test " > " out " 2>&1")
- cmd="diff -c " chk " " out " >> " err
- print test >> err
- print system(cmd) ? "[FAILED]" : "[OK]"
- }' $i
+ rm -f $out $chk
+ awk '/^name:/ {printf "Running %s ", $2}
+ /^output:$/ {copyon=1; next}
+ /^\*\// {copyon=0; next}
+ copyon==1 {print > "'$chk'"}' $i
+
+ ../cc1 -I. -w $i > $out 2>&1
+ if diff -c $chk $out >> test.log
+ then
+ echo [OK]
+ else
+ echo [FAILED]
+ fi
done
Received on Tue Nov 24 2015 - 15:16:26 CET
This archive was generated by hypermail 2.3.0
: Tue Nov 24 2015 - 15:24:12 CET