commit 14474dfd1a3b9a3912b4b73980ed6dad1f604576
Author:     Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Tue Nov 24 15:08:06 2015 +0100
Commit:     Roberto E. Vargas Caballero <[email protected]>
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
@@ -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

Reply via email to