diff mbox

[fixincludes] Fix pthread.h failure (PR other/52626)

Message ID 4F6BAA4B.8050508@gnu.org
State New
Headers show

Commit Message

Bruce Korb March 22, 2012, 10:40 p.m. UTC
> Rather simple...  In a file called fixinclude.sum, put
>
>    PASS: unique string
>
> or
>
>    FAIL: unique string
>
> one per line,
>
> Bonus points if you can total passes and failures:

I think you just put it into the check template so it creates the result.
Since multiple fixes tweak the same file, there really isn't a way to
figure out what has passed.  You can only figure out what has failed.
So, let's just call it one test.

+fix_sum_fmt='%s: fixincludes
+
+# of expected passes            1
+# of expected failures          0
+# of unexpected failures        %s\n'

Do I get the bonus points? :D

Comments

Mike Stump March 23, 2012, 12:22 a.m. UTC | #1
On Mar 22, 2012, at 3:40 PM, Bruce Korb wrote:
> You can only figure out what has failed.

Life goes on....

> Do I get the bonus points?

make check

and cat fixincludes.sum

is necessary to get the bonus points.  :-)  Looks fine from what I can see.
diff mbox

Patch

Index: check.tpl
===================================================================
--- check.tpl	(revision 184997)
+++ check.tpl	(working copy)
@@ -25,7 +25,7 @@ 
 
 rm -rf ${DESTDIR} ${SRCDIR}
 mkdir ${DESTDIR} ${SRCDIR}
-(
+{
 [=
   (shellf
     "for f in %s
@@ -36,7 +36,7 @@ 
      while read g
      do echo \"  mkdir \\${SRCDIR}/$g || mkdir -p \\${SRCDIR}/$g || exit 1\"
      done" (join " " (stack "fix.files"))  ) =]
-) 2> /dev/null[= # suppress 'No such file or directory' messages =]
+} 2> /dev/null[= # suppress 'No such file or directory' messages =]
 cd inc
 [=
 (define sfile "")
@@ -114,29 +114,21 @@ 
 sed 's/\(#define __[A-Z_]*_TYPE__\).*/\1/' sys/types.h > XX
 mv -f XX sys/types.h
 
-#  The following subshell weirdness is for saving an exit
-#  status from within a while loop that reads input.  If you can
-#  think of a cleaner way, suggest away, please...
-#
-exitok=`
 exec < ${TESTDIR}/LIST
 while read f
 do
   if [ ! -f ${TESTBASE}/$f ]
   then
-    echo "Newly fixed header:  $f" >&2
-    exitok=false
+    echo "FAIL: Newly fixed header:  $f" >&2
 
-  elif cmp $f ${TESTBASE}/$f >&2
+  elif cmp $f ${TESTBASE}/$f
   then
     :
 
   else
-    ${DIFF:-diff} -c $f ${TESTBASE}/$f >&2 || :
-    exitok=false
+    ${DIFF:-diff} -c $f ${TESTBASE}/$f
   fi
-done
-echo $exitok`
+done > FAILURES.txt
 
 cd $TESTBASE
 
@@ -144,30 +136,36 @@ 
 fgrep -v 'CVS/' | \
 fgrep -v '.svn/' > ${TESTDIR}/LIST
 
-exitok=`
 exec < ${TESTDIR}/LIST
 while read f
 do
   if [ -s $f ] && [ ! -f ${DESTDIR}/$f ]
   then
-    echo "Missing header fix:  $f" >&2
-    exitok=false
+    echo "FAIL: Missing header fix:  $f"
   fi
-done
-echo $exitok`
+done >> ${DESTDIR}/FAILURES.txt
+
+fix_sum_fmt='%s: fixincludes
+
+# of expected passes            1
+# of expected failures          0
+# of unexpected failures        %s\n'
 
 echo
-if $exitok
+if test -s ${DESTDIR}/FAILURES.txt
 then
-  cd ${TESTDIR}
-  rm -rf inc res LIST
-  cd ..
-  rmdir ${TESTDIR} > /dev/null 2>&1 || :
-  echo All fixinclude tests pass >&2
-else
-  echo There were fixinclude test FAILURES  >&2
-fi
-$exitok[=
+  echo There were fixinclude test FAILURES
+  cat ${DESTDIR}/FAILURES.txt
+  printf "$fix_sum_fmt" FAIL 1 > ${DESTDIR}/fixincludes.sum
+  exit 1
+fi  >&2
+
+printf "$fix_sum_fmt" PASS 0 > ${DESTDIR}/fixincludes.sum
+cd ${TESTDIR}
+rm -rf inc res LIST
+cd ..
+rmdir ${TESTDIR} > /dev/null 2>&1 || :
+echo All fixinclude tests pass >&2[=
 
 (if (defined? 'set-writable) (set-writable))