From patchwork Tue Feb 14 16:39:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Quentin Neill X-Patchwork-Id: 141132 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 B30AC1007D3 for ; Wed, 15 Feb 2012 03:40:01 +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=1329842403; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:In-Reply-To:References:Date: Message-ID:Subject:From:To:Cc:Content-Type: Content-Transfer-Encoding:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=XJeLj4TxMExCDPQjATzjy2QgNRE=; b=dw06NPQc2Ktymb9 APub76HjKJ3gminhbtxoW2SNaz/NxLq1gw7dW4n8BLMYIfj1BB6/T9QeyoY0HzBJ HJ1q+lIb2JbX+XdCICAhSN8TMIwRsZGAWQOQCYM5b8PfU4BlMAbSn5LDf6RHSVTQ oQxzHSKQQnokYCJfUtuN33RMUvqc= 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:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type:Content-Transfer-Encoding:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=ugwh6hYq8lwZcO05qRyaeuE+7IDx0Z62BxaoAn7OOtNloHdIEM+TS5A8Q/umSW X1kCShjfHq4r/bRzOKPBqDjCrwxSK0FYS72Qsv+yKJ5INGe/oSxHaeoQZUj4grC5 keNppzdjnAoMjpmZeO+Ei95tlXZXlfdrsRFVLXqT4HW3E=; 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 10:39:36 -0600 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 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 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 -strict. >> This patch concatenates the common .sum files before comparing. > > So, how exactly does this work for you: > > +       ( 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 > > 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): [ "$1" = "-?" ] && usage @@ -60,8 +62,8 @@ if [ -d "$1" -a -d "$2" ] ; then echo "## Dir2=$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=$1" @@ -83,14 +85,11 @@ if [ -d "$1" -a -d "$2" ] ; then exit $exit_status fi cmnsums=`cat $lst5 | wc -l` - sum1="/tmp/$tool-sum-1" - sum2="/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=$? if [ $ret -ne 0 ]; then exit_status=`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=$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=$1" And if so, okay to commit? --- a/contrib/compare_tests +++ b/contrib/compare_tests @@ -43,7 +43,9 @@ lst2=/tmp/$tool-lst2.$$ lst3=/tmp/$tool-lst3.$$ lst4=/tmp/$tool-lst4.$$ lst5=/tmp/$tool-lst5.$$ -tmps="$tmp1 $tmp2 $now_s $before_s $lst1 $lst2 $lst3 $lst4 $lst5" +sum1=/tmp/$tool-sum1.$$ +sum2=/tmp/$tool-sum2.$$ +tmps="$tmp1 $tmp2 $now_s $before_s $lst1 $lst2 $lst3 $lst4 $lst5 $sum1 $sum2" [ "$1" = "-strict" ] && strict=$1 && shift