X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=contrib%2Ftest_summary;h=c4b3c2c9369b3748a41b0f27ce47cb7683fce384;hb=7019ea7985955f2fb53ce18d3c9cb05b4cc6046e;hp=6f2d6b0ceea0ae8c20589c58b48258f8c1b8d29d;hpb=5771cabf686127cdbe569eadb55e0dfaa9141121;p=pf3gnuchains%2Fgcc-fork.git diff --git a/contrib/test_summary b/contrib/test_summary index 6f2d6b0ceea..c4b3c2c9369 100755 --- a/contrib/test_summary +++ b/contrib/test_summary @@ -1,6 +1,8 @@ #! /bin/sh -# (C) 1998 Alexandre Oliva +# (C) 1998, 1999, 2000, 2002, 2003, 2004, 2007, 2009 +# Free Software Foundation +# Originally by Alexandre Oliva # This script is Free Software, and it can be copied, distributed and # modified as defined in the GNU General Public License. A copy of @@ -8,8 +10,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 @@ -22,16 +24,24 @@ # The usage pattern of this script is as follows: -# summarize | more # so as to observe what should be done +# test_summary | more # so as to observe what should be done -# summarize | sh # so as to actually send e-mail and move log files +# 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 -# -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 @@ -44,13 +54,14 @@ if test -z "$AWK" ; then done fi -: ${filesuffix=}; export fileprefix +: ${filesuffix=}; export filesuffix : ${move=true}; export move : ${forcemail=false}; export forcemail while true; do case "$1" in -o) filesuffix=.sent; move=false; : ${mailto=nobody}; shift;; -t) move=false; shift;; + -p) prepend_logs=${prepend_logs+"$prepend_logs "}"$2"; shift 2;; -i) append_logs=${append_logs+"$append_logs "}"$2"; shift 2;; -m) mailto=$2; forcemail=true; shift 2;; -f) unset mailto; forcemail=true; shift;; @@ -58,7 +69,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 ] && @@ -77,40 +88,56 @@ 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. +( echo @TOPLEVEL_CONFIGURE_ARGUMENTS@ | ./config.status --file=-; cat $files ) | $AWK ' BEGIN { - lang=""; - print "cat <0 { print; --blanks; } END { if (lang != "") { print ""; + print "Compiler version: " prefix version lang; + print "Platform: " host; print configflags; '${BOOT_CFLAGS+'print "BOOT_CFLAGS='"${BOOT_CFLAGS}"'";'}' if (boot_cflags != 0) print boot_cflags; @@ -119,10 +146,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