From patchwork Thu Mar 22 22:40:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Korb X-Patchwork-Id: 148351 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 4FAC3B6EF4 for ; Fri, 23 Mar 2012 09:40:38 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1333060838; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Message-ID:Date:From:Reply-To:User-Agent:MIME-Version: To:CC:Subject:References:In-Reply-To:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=n10lpWAlxc1/1P6bT5HydSZ51PQ=; b=yFq0GUNn6te4zvVITwFPYDH2vdqxLpSopsmrhLhmKUhH4RH1Y0mSMkYW7+Xfkf 23ot2KDYhU4nJJVlnnQyZ2NLkNcENEAUhE75PO1tSD6Mw1qKLfE5f/UXBWX61B3m ROU7IiGOxSrnpJnmUA5JAwaB+EiRtuLHo//USifowXFro= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Message-ID:Date:From:Reply-To:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=VcwLH9z2HeBONSpSF8C9XoLUU4BZaWHVTyd/qkSJxkLuT9BF3M4tjVJRFhayEH ZTDuBUXswaW+VqUXqSajhI9cZd18963m9vapxwmPrHaSOb/qTB9smkbnjMxSi/pe lcKjqdDQkNGgA8Xjk6s9quml+s8ovu9HtOdC9h1sYFK2o=; Received: (qmail 8684 invoked by alias); 22 Mar 2012 22:40:31 -0000 Received: (qmail 8428 invoked by uid 22791); 22 Mar 2012 22:40:28 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-pb0-f47.google.com (HELO mail-pb0-f47.google.com) (209.85.160.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 22 Mar 2012 22:40:14 +0000 Received: by pbcum15 with SMTP id um15so1994359pbc.20 for ; Thu, 22 Mar 2012 15:40:13 -0700 (PDT) Received: by 10.68.191.161 with SMTP id gz1mr18036045pbc.76.1332456013925; Thu, 22 Mar 2012 15:40:13 -0700 (PDT) Received: from [192.168.10.2] ([75.0.182.150]) by mx.google.com with ESMTPS id h10sm4529238pbe.12.2012.03.22.15.40.12 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Mar 2012 15:40:13 -0700 (PDT) Message-ID: <4F6BAA4B.8050508@gnu.org> Date: Thu, 22 Mar 2012 15:40:11 -0700 From: Bruce Korb Reply-To: bkorb@gnu.org User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Mike Stump CC: Rainer Orth , gcc-patches@gcc.gnu.org Subject: Re: [fixincludes] Fix pthread.h failure (PR other/52626) References: <14D8C182-D730-431D-9EFE-2CA68439C79A@comcast.net> In-Reply-To: <14D8C182-D730-431D-9EFE-2CA68439C79A@comcast.net> X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org > 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 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))