OSDN Git Service

2009-04-10 David Billinghurst <billingd@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / contrib / test_summary
index 356d7b3..9bb0605 100755 (executable)
@@ -1,6 +1,7 @@
 #! /bin/sh
 
-# (C) 1998, 1999, 2000, 2002 Free Software Foundation
+# (C) 1998, 1999, 2000, 2002, 2003, 2004, 2007, 2009
+# Free Software Foundation
 # Originally by Alexandre Oliva <oliva@dcc.unicamp.br>
 
 # This script is Free Software, and it can be copied, distributed and
 # test_summary | sh     # so as to actually send e-mail and move log files
 
 # It accepts a few command line arguments.  For example:
-# -o: re-reads logs that have been mailed already (.sum.sent)
-# -t: prevents logs from being renamed
-# -p: prepend specified file (or list of files: -p "a b") to the report
-# -i: append specified file (or list of files: -i "a b") to the report
-# -m: specify the e-mail address to send notes to.  An appropriate default
-#     should be selected from the log files.
-# -f: force reports to be mailed; if omitted, only reports that differ
-#     from the sent.* version are sent.
+if test x"$1" = "x-h"; then
+  cat <<_EOF
+ -o: re-reads logs that have been mailed already (.sum.sent)
+ -t: prevents logs from being renamed
+ -p: prepend specified file (or list of files: -p "a b") to the report
+ -i: append specified file (or list of files: -i "a b") to the report
+ -m: specify the e-mail address to send notes to.  An appropriate default
+     should be selected from the log files.
+ -f: force reports to be mailed; if omitted, only reports that differ
+     from the sent.* version are sent.
+_EOF
+  exit 0
+fi
 
 # Find a good awk.
 if test -z "$AWK" ; then
@@ -98,13 +104,17 @@ BEGIN {
 configflags == "" {
     configflags = $0 " ";
     sub(/^# /, "", configflags);
+    sub(/^s,@TOPLEVEL_CONFIGURE_ARGUMENTS@,/, "", configflags);
     srcdir = configflags;
     sub(/\/configure .*/, "", srcdir);
-    printf "LAST_UPDATED: ";
-    system("tail -1 " srcdir "/LAST_UPDATED");
-    print "";
+    if ( system("test -f " srcdir "/LAST_UPDATED") == 0 ) {
+        printf "LAST_UPDATED: ";
+        system("tail -1 " srcdir "/LAST_UPDATED");
+        print "";
+    }
 
     sub(/^[^ ]*\/configure */, " ", configflags);
+    sub(/,;t t $/, " ", configflags);
     sub(/ --with-gcc-version-trigger=[^ ]* /, " ", configflags);
     sub(/ --norecursion /, " ", configflags);
     sub(/ $/, "", configflags);
@@ -122,6 +132,7 @@ $2 == "version" { save = $0; $1 = ""; $2 = ""; version = $0; gsub(/^ */, "", ver
 /\===.*Summary/ { print ""; print; blanks=1; }
 /tests ===/ || /^(Target|Host|Native)/ || $2 == "version" { print; blanks=1; }
 /^(XPASS|FAIL|UNRESOLVED|WARNING|ERROR|# of )/ { print; }
+/^using:/ { print ""; print; print ""; }
 # dumpall != 0 && /^X?(PASS|FAIL|UNTESTED)|^testcase/ { dumpall=0; }
 # dumpall != 0 { print; }
 # /^FAIL/ { dumpall=1; }