From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14542 invoked by alias); 14 Feb 2012 16:39:54 -0000 Received: (qmail 14257 invoked by uid 22791); 14 Feb 2012 16:39:51 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-iy0-f175.google.com (HELO mail-iy0-f175.google.com) (209.85.210.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Feb 2012 16:39:36 +0000 Received: by iaby12 with SMTP id y12so159302iab.20 for ; Tue, 14 Feb 2012 08:39:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.42.157.196 with SMTP id e4mr15151862icx.3.1329237576202; Tue, 14 Feb 2012 08:39:36 -0800 (PST) Received: by 10.231.15.4 with HTTP; Tue, 14 Feb 2012 08:39:36 -0800 (PST) In-Reply-To: <7F0115C8-1F88-4567-81A9-C8AEA5CF1B59@comcast.net> References: <4CD2433B-1994-4834-A595-131242428431@comcast.net> <7F0115C8-1F88-4567-81A9-C8AEA5CF1B59@comcast.net> Date: Tue, 14 Feb 2012 16:41:00 -0000 Message-ID: Subject: Re: PATCH: Add capability to contrib/compare_tests to handle directories From: Quentin Neill To: Mike Stump Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-02/txt/msg00721.txt.bz2 On Sat, Feb 11, 2012 at 8:13 AM, Mike Stump wrote: > On Nov 4, 2011, at 8:23 PM, Quentin Neill wrote: >> My scenario about "ANY test results changed" is what I added with -stric= t. >> This patch concatenates the common .sum files before comparing. > > So, how exactly does this work for you: > > + =A0 =A0 =A0 ( for fname in `cat $lst5`; do cat $1/$fname; done ) >$sum1 > + =A0 =A0 =A0 ( for fname in `cat $lst5`; do cat $2/$fname; done ) >$sum2 > + =A0 =A0 =A0 echo "## ${CONFIG_SHELL-/bin/sh} $0 $strict $sum1 $sum2" > + =A0 =A0 =A0 ${CONFIG_SHELL-/bin/sh} $0 $strict $sum1 $sum2 > > sum1 and sum2 appear to be variables that aren't set. Hi Mike, Thanks for the fix. This seemed familiar, and upon review it looks like I never committed this fix: http://gcc.gnu.org/ml/gcc-patches/2011-11/msg01194.html Do you prefer this patch with my original intent (declaring sum1/sum2 with other tmps and removing the trap on line 52): --- a/contrib/compare_tests +++ b/contrib/compare_tests @@ -43,7 +43,9 @@ lst2=3D/tmp/$tool-lst2.$$ lst3=3D/tmp/$tool-lst3.$$ lst4=3D/tmp/$tool-lst4.$$ lst5=3D/tmp/$tool-lst5.$$ -tmps=3D"$tmp1 $tmp2 $now_s $before_s $lst1 $lst2 $lst3 $lst4 $lst5" +sum1=3D/tmp/$tool-sum1.$$ +sum2=3D/tmp/$tool-sum2.$$ +tmps=3D"$tmp1 $tmp2 $now_s $before_s $lst1 $lst2 $lst3 $lst4 $lst5 $sum1 $= sum2" [ "$1" =3D "-strict" ] && strict=3D$1 && shift [ "$1" =3D "-?" ] && usage @@ -60,8 +62,8 @@ if [ -d "$1" -a -d "$2" ] ; then echo "## Dir2=3D$2: `cat $lst2 | wc -l` sum files" echo # remove leading directory components to compare - sed -e "s|^$1/||" $lst1 | sort >$lst3 - sed -e "s|^$2/||" $lst2 | sort >$lst4 + sed -e "s|^$1[/]*||" $lst1 | sort >$lst3 + sed -e "s|^$2[/]*||" $lst2 | sort >$lst4 comm -23 $lst3 $lst4 >$lst5 if [ -s $lst5 ] ; then echo "# Extra sum files in Dir1=3D$1" @@ -83,14 +85,11 @@ if [ -d "$1" -a -d "$2" ] ; then exit $exit_status fi cmnsums=3D`cat $lst5 | wc -l` - sum1=3D"/tmp/$tool-sum-1" - sum2=3D"/tmp/$tool-sum-2" echo "# Comparing $cmnsums common sum files" ( for fname in `cat $lst5`; do cat $1/$fname; done ) >$sum1 ( for fname in `cat $lst5`; do cat $2/$fname; done ) >$sum2 echo "## ${CONFIG_SHELL-/bin/sh} $0 $strict $sum1 $sum2" ${CONFIG_SHELL-/bin/sh} $0 $strict $sum1 $sum2 - rm -f $sum1 $sum2 ret=3D$? if [ $ret -ne 0 ]; then exit_status=3D`expr $exit_status + 1` Or would you prefer this minimal fix (to remove trailing directory slashes)? @@ -60,8 +60,8 @@ if [ -d "$1" -a -d "$2" ] ; then echo "## Dir2=3D$2: `cat $lst2 | wc -l` sum files" echo # remove leading directory components to compare - sed -e "s|^$1/||" $lst1 | sort >$lst3 - sed -e "s|^$2/||" $lst2 | sort >$lst4 + sed -e "s|^$1[/]*||" $lst1 | sort >$lst3 + sed -e "s|^$2[/]*||" $lst2 | sort >$lst4 comm -23 $lst3 $lst4 >$lst5 if [ -s $lst5 ] ; then echo "# Extra sum files in Dir1=3D$1" And if so, okay to commit? --=20 Quentin