This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Add capability to contrib/compare_tests to handle directories
On Sat, Nov 5, 2011 at 4:26 PM, Mike Stump <mikestump@comcast.net> wrote:
> On Nov 4, 2011, at 8:23 PM, Quentin Neill wrote:
>> This patch concatenates the common .sum files before comparing.
>>
>> Okay to commit?
>
> Ok, thanks for the contribution.
>
FYI I see my patch was missing these two fixes:
1. fix missing sum1 and sum2 temp variables
2. handle trailing slashes in dir args
Okay to commit? Should I commit such a patch as trivial?
--
Quentin
Index: compare_tests
===================================================================
--- compare_tests (revision 181166)
+++ compare_tests (working copy)
@@ -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
[ "$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"