OSDN Git Service

* test_summary (configflags): awk portability.
[pf3gnuchains/gcc-fork.git] / contrib / test_summary
index 387beb8..a56f581 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# (C) 1998 Free Software Foundation
+# (C) 1998, 1999, 2000, 2002 Free Software Foundation
 # Originally by Alexandre Oliva <oliva@dcc.unicamp.br>
 
 # This script is Free Software, and it can be copied, distributed and
@@ -9,8 +9,8 @@
 
 # This script processes *.{sum,log} files, producing a shell-script
 # that sends e-mail to the appropriate lists and renames files to
-# *.sent.  It currently handles gcc and egcs, but it should be quite
-# easy to modify it to handle other packages and its mailing lists.
+# *.sent.  It currently handles only gcc, but it should be quite easy
+# to modify it to handle other packages and its mailing lists.
 
 # The scripts assumes it is run in the root directory of the build
 # tree, and it will include all .sum files it finds in the mail
@@ -48,7 +48,7 @@ if test -z "$AWK" ; then
   done
 fi
 
-: ${filesuffix=}; export fileprefix
+: ${filesuffix=}; export filesuffix
 : ${move=true}; export move
 : ${forcemail=false}; export forcemail
 while true; do
@@ -63,7 +63,7 @@ while true; do
     esac
 done
 : ${mailto="\" address \""}; export mailto
-files=`find . -name \*.sum$filesuffix -print`
+files=`find . -name \*.sum$filesuffix -print | sort`
 anyfile=false anychange=$forcemail &&
 for file in $files; do
     [ -f $file ] &&
@@ -82,35 +82,43 @@ for file in $files; do
 done &&
 $anyfile &&
 if $forcemail || $anychange; then :; else mailto=nobody; fi &&
+# We use cat instead of listing the files as arguments to AWK because
+# GNU awk 3.0.0 would break if any of the filenames contained `=' and
+# was preceded by an invalid ``variable'' name.
+cat ./config.status $files |
 $AWK '
 BEGIN {
   lang="";
-  print "cat <<\\EOF |";
+  address="gcc-testresults@gcc.gnu.org";
+  version="gcc";
+  print "cat <<'"'"'EOF'"'"' |";
 '${prepend_logs+"  system(\"cat $prepend_logs\"); "}'
 }
-$1 ~ /\/configure$/ { $1 = "configure flags:"; configflags = $0 }
+$0 ~ /^[^ ]*\/configure / || $0 ~ /^# [^ ]*\/configure / {
+    configflags = $0 " ";
+    gsub(/^# /, "", configflags);
+    srcdir = configflags;
+    gsub(/\/configure .*/, "", srcdir);
+    printf "LAST_UPDATED: ";
+    system("tail -1 " srcdir "/LAST_UPDATED");
+    print "";
+
+    gsub(/^[^ ]*\/configure /, "configure flags: ", configflags);
+    gsub(/ --with-gcc-version-trigger=[^ ]* /, " ", configflags);
+    gsub(/ --norecursion /, " ", configflags);
+    gsub(/ $/, "", configflags);
+}
 /^Running target / { print ""; print; }
 /^Target / { if (host != "") next; else host = $3; }
+/^Host / && host ~ /^unix\{.*\}$/ { host = $3 " " substr(host, 5); }
 /^Native / { if (host != "") next; else host = $4; }
 /^[    ]*=== [^        ]+ tests ===/ {
   if (lang == "") lang = " "$2" "; else lang = " ";
 }
-/\/ss(\/|c? )/ {
-  program="ss";
-  if (lang == " ") address="nobody";
-  else if (lang == " gcc ") address="gcc2@cygnus.com";
-  else address="g++@cygnus.com";
-}
-/\/egcsh?((-[^ ]*)?\/|c?[ -])/ {
-  address="egcs-testresults@egcs.cygnus.com";
-  if (version == 0) version="egcs";
-}
-/--disable-haifa/ { prefix="haifa-disabled "; }
-/--enable-haifa/ { prefix="haifa-enabled "; }
-$2 == "version" { save = $0; $1 = ""; $2 = ""; version = $0; gsub(/^ */, "", version); $0 = save; }
+$2 == "version" { save = $0; $1 = ""; $2 = ""; version = $0; gsub(/^ */, "", version); gsub(/\r$/, "", version); $0 = save; }
 /\===.*Summary/ { print ""; print; blanks=1; }
 /tests ===/ || /^(Target|Host|Native)/ || $2 == "version" { print; blanks=1; }
-/^(XPASS|FAIL|# of )/ { print; }
+/^(XPASS|FAIL|UNRESOLVED|WARNING|ERROR|# of )/ { print; }
 # dumpall != 0 && /^X?(PASS|FAIL|UNTESTED)|^testcase/ { dumpall=0; }
 # dumpall != 0 { print; }
 # /^FAIL/ { dumpall=1; }
@@ -127,10 +135,10 @@ END { if (lang != "") {
   print "Mail -s \"Results for " prefix version lang "testsuite on " host "\" '"${mailto}"' &&";
 }}
 { next; }
-' ./config.status $files | sed "s/\([\`\$\\\\]\)/\\\\\\1/g" &&
+' | sed "s/\([\`\$\\\\]\)/\\\\\\1/g" &&
 if $move; then
     for file in $files `ls -1 $files | sed s/sum$/log/`; do
-      [ -f $file ] && echo "mv `pwd`/$file `pwd`/$file.sent &&"
+      [ -f $file ] && echo "mv `${PWDCMD-pwd}`/$file `${PWDCMD-pwd}`/$file.sent &&"
     done
 fi &&
 echo true