compare_tests: Fix trailing paths in dir arguments.

2012-02-15   Quentin Neill  <quentin.neill@amd.com>

	* compare_tests: Fix trailing paths in dir arguments.
	Handle sum1/sum2 temp files with others.

From-SVN: r184284
This commit is contained in:
Quentin Neill 2012-02-15 20:58:40 +00:00 committed by Quentin Neill
parent 2a5d011c41
commit e53182b762
2 changed files with 10 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2012-02-15 Quentin Neill <quentin.neill@amd.com>
* compare_tests: Fix trailing paths in dir arguments.
Handle sum1/sum2 temp files with others.
2012-02-14 Walter Lee <walt@tilera.com>
* config-list.mk (LIST): Add tilegx-linux-gnu and

View File

@ -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"
@ -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`