This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: comparing DejaGNU results
- From: James Lemke <jwlemke at wasabisystems dot com>
- To: Mike Stump <mrs at apple dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 01 Jun 2006 15:44:32 -0400
- Subject: Re: comparing DejaGNU results
- References: <1149099224.7265.396.camel@winch.thelemkes.ca> <C330B40D-FA23-40B6-8A56-1F5967285D6F@apple.com>
Whoops... I forgot to attach my fixes, for anyone that's interested.
--
Jim Lemke jwlemke@wasabisystems.com Orillia, Ontario
--- dg-cmp-results.sh 2006/05/31 19:22:14 1.18
+++ dg-cmp-results.sh 2006/06/01 17:53:21
@@ -31,6 +31,16 @@ if test $# -ne 3 -o ! -f "$2" -o ! -f "$
exit 1
fi
+# Command differences for various platforms.
+case `uname -s` in
+Darwin|NetBSD)
+ E=-E # sed
+ ;;
+*)
+ E=-r # sed
+ ;;
+esac
+
# sections are identified by separator lines beginning with '\t\t==='.
# section 0 identifies run date, target, and host.
# section 1 and subsequent contain test data for a target variant.
@@ -62,15 +72,15 @@ unset temp
# Copy out the old file's section 0.
echo "Older log file: $OFILE"
-sed -r -e '/^\t+===/,$d' $OFILE
+sed $E -e '/^[[:space:]]+===/,$d' $OFILE
# Copy out the new file's section 0.
echo "Newer log file: $NFILE"
-sed -r -e '/^\t+===/,$d' $NFILE
+sed $E -e '/^[[:space:]]+===/,$d' $NFILE
# Create a temporary file from the old file's interesting section.
-sed -r -e "1,/$header/d" \
- -e '/^\t+===/,$d' \
+sed $E -e "1,/$header/d" \
+ -e '/^[[:space:]]+===/,$d' \
-e '/^[A-Z]+:/!d' \
-e 's/\r$//' \
-e 's/^/O:/' \
@@ -79,8 +89,8 @@ sed -r -e "1,/$header/d" \
>/tmp/o$$-$OBASE
# Create a temporary file from the new file's interesting section.
-sed -r -e "1,/$header/d" \
- -e '/^\t+===/,$d' \
+sed $E -e "1,/$header/d" \
+ -e '/^[[:space:]]+===/,$d' \
-e '/^[A-Z]+:/!d' \
-e 's/\r$//' \
-e 's/^/N:/' \
@@ -94,9 +104,9 @@ sed -r -e "1,/$header/d" \
# If so, we assume that the order is the same in both files.
IFS=:
firstread=Y
-sort --merge -s -t : -k 3b /tmp/o$$-$OBASE /tmp/n$$-$NBASE |
+sort -m -s -t : -k 3b /tmp/o$$-$OBASE /tmp/n$$-$NBASE |
while read -r lineon linestatus linename; do
- linename=`echo "$linename" |sed -r -e 's/^ *(.*) *$/\1/'`
+ linename=`echo "$linename" |sed $E -e 's/^ *(.*) *$/\1/'`
if test $verbose -ge 4; then
case "$linestatus" in
@@ -231,15 +241,15 @@ while read -r lineon linestatus linename
else
##echo "$lines" |read -r prevon prevstatus prevname
line=`echo "$lines" |head -n 1`
- prevon=`echo "$line" |sed -r -e 's/\s*(.):([A-Z]+):(.*)$/\1/'`
- prevstatus=`echo "$line" |sed -r -e 's/\s*(.):([A-Z]+):(.*)$/\2/'`
- prevname=`echo "$line" |sed -r -e 's/\s*(.):([A-Z]+):(.*)$/\3/'`
+ prevon=`echo "$line" |sed $E -e 's/ *(.):([A-Z]+):(.*)$/\1/'`
+ prevstatus=`echo "$line" |sed $E -e 's/ *(.):([A-Z]+):(.*)$/\2/'`
+ prevname=`echo "$line" |sed $E -e 's/ *(.):([A-Z]+):(.*)$/\3/'`
if test $verbose -ge 4; then
echo " debug: pulled a line from the stack"
fi
#lines=`echo "$lines" |tail -n $numlines`
- lines=`echo "$lines" |sed -e 1d`
+ lines=`echo "$lines" |sed $E -e 1d`
fi
;;
*)