From 6c0098673b7e6e47c026b9827ce3e0d6ccc149db Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Mon, 11 Oct 2010 18:04:01 +0000 Subject: [PATCH] New contrib/test_recheck script to rerun unsuccessful tests. contrib/: * test_recheck: New script. From-SVN: r165324 --- contrib/ChangeLog | 4 ++ contrib/test_recheck | 98 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100755 contrib/test_recheck diff --git a/contrib/ChangeLog b/contrib/ChangeLog index b98ef7bc989..c7152afe169 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,7 @@ +2010-10-11 Ralf Wildenhues + + * test_recheck: New script. + 2010-08-22 Ralf Wildenhues * texi2pod.pl: Replace @@ before @{ and @}, for @samp{@@}. diff --git a/contrib/test_recheck b/contrib/test_recheck new file mode 100755 index 00000000000..193cd3df2a3 --- /dev/null +++ b/contrib/test_recheck @@ -0,0 +1,98 @@ +#! /bin/sh + +# (C) 2010 Free Software Foundation +# Written by Ralf Wildenhues . + +# This script is Free Software, and it can be copied, distributed and +# modified as defined in the GNU General Public License. A copy of +# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html + +PROGNAME=test_recheck + +usage () +{ + cat <&2 + exit 1 +} + +dry= +for arg +do + case $arg in + -h | \?) usage ;; + -n) dry=:; shift ;; + -*) error "unknown argument $arg" ;; + *) break ;; + esac +done +test $# -gt 0 || usage + +# Find a good awk. +if test -z "$AWK" ; then + for AWK in gawk nawk awk + do + if type $AWK 2>&1 | grep 'not found' > /dev/null 2>&1 ; then + : + else + break + fi + done +fi + +: ${MAKE=make} +: ${filesuffix=} +cwd=`pwd` +files=`find "$@" -name \*.sum$filesuffix -print | grep testsuite | sort` +st=0 + +for file in $files; do + dir=`echo $file | sed 's,/[^/]*$,,'` + base=`echo $file | sed 's,.*/,,; s,\.sum$,,'` + flags=`$AWK ' +/^Running .*\.exp \.\.\./ { + if (expfile != "" && tests != "") + printf (" %s=\"%s\"", expfile, tests) + expfile = $2 + sub (/^[^ ]*\//, "", expfile) + sep = "" + tests = "" +} +/^(FAIL|XPASS|UNRESOLVED|WARNING|ERROR): / { + if (test != $2 "" && $2 != "" ) { + test = $2 + tests = tests sep test + sep = " " + } +} +END { + if (expfile != "" && tests != "") + printf (" %s=\"%s\"", expfile, tests) +}' $file` + if test -n "$flags"; then + cd $dir + amflags= + if grep '^AM_RUNTESTFLAGS =' Makefile >/dev/null 2>&1; then + amflags=`echo 'print-runtestflags: ; @echo $(AM_RUNTESTFLAGS)' \ + | ${MAKE} -s -f Makefile -f - print-runtestflags` + fi + echo "(cd $dir && runtest $amflags --tool $base $flags)" + if test -z "$dry"; then + eval runtest --tool $base $flags || st=$? + fi + cd "$cwd" + fi +done +exit $st -- 2.30.2