X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=contrib%2Ftest_summary;h=5fc49f52bda7a7ab0eedef0e9f6f96924b69f4bd;hb=0b4a769ec91b21d7d5237d3ba60d02c90304dc33;hp=5b9cdc8f39ed7e5dcf028d0e2f4d029d5a1e60c6;hpb=1e6347d8b985c539ddce9bce71b3483ace55ec74;p=gcc.git diff --git a/contrib/test_summary b/contrib/test_summary index 5b9cdc8f39e..5fc49f52bda 100755 --- a/contrib/test_summary +++ b/contrib/test_summary @@ -1,6 +1,7 @@ #! /bin/sh -# (C) 1998, 1999, 2000, 2002 Free Software Foundation +# (C) 1998, 1999, 2000, 2002, 2003, 2004, 2007, 2009, 2010 +# Free Software Foundation # Originally by Alexandre Oliva # This script is Free Software, and it can be copied, distributed and @@ -28,14 +29,19 @@ # 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 @@ -69,9 +75,9 @@ for file in $files; do [ -f $file ] && anyfile=true && { $anychange || - anychange=`diff -u $file.sent $file 2>/dev/null | + anychange=`diff $file.sent $file 2>/dev/null | if test ! -f $file.sent || - egrep '^[-+](XPASS|FAIL)' >/dev/null; then + egrep '^[<>] (XPASS|FAIL)' >/dev/null; then echo true else echo false @@ -85,25 +91,32 @@ 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 | +( echo @TOPLEVEL_CONFIGURE_ARGUMENTS@ | ./config.status --file=-; cat $files ) | $AWK ' BEGIN { - lang=""; + lang=""; configflags = ""; address="gcc-testresults@gcc.gnu.org"; version="gcc"; print "cat <<'"'"'EOF'"'"' |"; '${prepend_logs+" system(\"cat $prepend_logs\"); "}' } -$1 ~ /\/configure$/ { - srcdir = $1; - gsub(/\/configure$/, "", srcdir); - printf "LAST_UPDATED: "; - system("tail -1 " srcdir "/LAST_UPDATED"); - print ""; +NR == 1 { + configflags = $0 " "; + srcdir = configflags; + sub(/\/configure .*/, "", srcdir); + if ( system("test -f " srcdir "/LAST_UPDATED") == 0 ) { + printf "LAST_UPDATED: "; + system("tail -1 " srcdir "/LAST_UPDATED"); + print ""; + } - $1 = "configure flags:"; configflags = $0; - gsub(/--with-gcc-version-trigger=[^ ]* /, "", configflags); - gsub(/ --norecursion/, "", configflags) + sub(/^[^ ]*\/configure */, " ", configflags); + sub(/,;t t $/, " ", configflags); + sub(/ --with-gcc-version-trigger=[^ ]* /, " ", configflags); + sub(/ --norecursion /, " ", configflags); + sub(/ $/, "", configflags); + sub(/^ *$/, " none", configflags); + configflags = "configure flags:" configflags; } /^Running target / { print ""; print; } /^Target / { if (host != "") next; else host = $3; } @@ -115,7 +128,8 @@ $1 ~ /\/configure$/ { $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|UNRESOLVED|WARNING|ERROR|# of )/ { print; } +/^(XPASS|FAIL|UNRESOLVED|WARNING|ERROR|# of )/ { sub ("\r", ""); print; } +/^using:/ { print ""; print; print ""; } # dumpall != 0 && /^X?(PASS|FAIL|UNTESTED)|^testcase/ { dumpall=0; } # dumpall != 0 { print; } # /^FAIL/ { dumpall=1; }