Commit e53182b7 by Quentin Neill Committed by Quentin Neill

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
parent 2a5d011c
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> 2012-02-14 Walter Lee <walt@tilera.com>
* config-list.mk (LIST): Add tilegx-linux-gnu and * config-list.mk (LIST): Add tilegx-linux-gnu and
......
...@@ -43,7 +43,9 @@ lst2=/tmp/$tool-lst2.$$ ...@@ -43,7 +43,9 @@ lst2=/tmp/$tool-lst2.$$
lst3=/tmp/$tool-lst3.$$ lst3=/tmp/$tool-lst3.$$
lst4=/tmp/$tool-lst4.$$ lst4=/tmp/$tool-lst4.$$
lst5=/tmp/$tool-lst5.$$ 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" = "-strict" ] && strict=$1 && shift
[ "$1" = "-?" ] && usage [ "$1" = "-?" ] && usage
...@@ -60,8 +62,8 @@ if [ -d "$1" -a -d "$2" ] ; then ...@@ -60,8 +62,8 @@ if [ -d "$1" -a -d "$2" ] ; then
echo "## Dir2=$2: `cat $lst2 | wc -l` sum files" echo "## Dir2=$2: `cat $lst2 | wc -l` sum files"
echo echo
# remove leading directory components to compare # remove leading directory components to compare
sed -e "s|^$1/||" $lst1 | sort >$lst3 sed -e "s|^$1[/]*||" $lst1 | sort >$lst3
sed -e "s|^$2/||" $lst2 | sort >$lst4 sed -e "s|^$2[/]*||" $lst2 | sort >$lst4
comm -23 $lst3 $lst4 >$lst5 comm -23 $lst3 $lst4 >$lst5
if [ -s $lst5 ] ; then if [ -s $lst5 ] ; then
echo "# Extra sum files in Dir1=$1" echo "# Extra sum files in Dir1=$1"
...@@ -83,14 +85,11 @@ if [ -d "$1" -a -d "$2" ] ; then ...@@ -83,14 +85,11 @@ if [ -d "$1" -a -d "$2" ] ; then
exit $exit_status exit $exit_status
fi fi
cmnsums=`cat $lst5 | wc -l` cmnsums=`cat $lst5 | wc -l`
sum1="/tmp/$tool-sum-1"
sum2="/tmp/$tool-sum-2"
echo "# Comparing $cmnsums common sum files" echo "# Comparing $cmnsums common sum files"
( for fname in `cat $lst5`; do cat $1/$fname; done ) >$sum1 ( for fname in `cat $lst5`; do cat $1/$fname; done ) >$sum1
( for fname in `cat $lst5`; do cat $2/$fname; done ) >$sum2 ( for fname in `cat $lst5`; do cat $2/$fname; done ) >$sum2
echo "## ${CONFIG_SHELL-/bin/sh} $0 $strict $sum1 $sum2" echo "## ${CONFIG_SHELL-/bin/sh} $0 $strict $sum1 $sum2"
${CONFIG_SHELL-/bin/sh} $0 $strict $sum1 $sum2 ${CONFIG_SHELL-/bin/sh} $0 $strict $sum1 $sum2
rm -f $sum1 $sum2
ret=$? ret=$?
if [ $ret -ne 0 ]; then if [ $ret -ne 0 ]; then
exit_status=`expr $exit_status + 1` exit_status=`expr $exit_status + 1`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment