URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [contrib/] [test_recheck] - Rev 723
Compare with Previous | Blame | View Log
#! /bin/sh# (C) 2010 Free Software Foundation# Written by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>.# 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.htmlPROGNAME=test_recheckusage (){cat <<EOFUsage: $PROGNAME [-h] [-n] DIR|FILE.sum...Rerun unsuccessful tests for testsuites below DIR or for FILE.sum.-h display this help and exit-n dry run, only show what would be runEOFexit $?}error (){echo "$@" >&2exit 1}dry=for argdocase $arg in-h | \?) usage ;;-n) dry=:; shift ;;-*) error "unknown argument $arg" ;;*) break ;;esacdonetest $# -gt 0 || usage# Find a good awk.if test -z "$AWK" ; thenfor AWK in gawk nawk awkdoif type $AWK 2>&1 | grep 'not found' > /dev/null 2>&1 ; then:elsebreakfidonefi: ${MAKE=make}: ${filesuffix=}cwd=`pwd`files=`find "$@" -name \*.sum$filesuffix -print | grep testsuite | sort`st=0for file in $files; dodir=`echo $file | sed 's,/[^/]*$,,'`base=`echo $file | sed 's,.*/,,; s,\.sum$,,'`flags=`$AWK '/^Running .*\.exp \.\.\./ {if (expfile != "" && tests != "")printf (" %s=\"%s\"", expfile, tests)expfile = $2sub (/^[^ ]*\//, "", expfile)sep = ""tests = ""}/^(FAIL|XPASS|UNRESOLVED|WARNING|ERROR): / {if (test != $2 "" && $2 != "" ) {test = $2tests = tests sep testsep = " "}}END {if (expfile != "" && tests != "")printf (" %s=\"%s\"", expfile, tests)}' $file`if test -n "$flags"; thencd $diramflags=if grep '^AM_RUNTESTFLAGS =' Makefile >/dev/null 2>&1; thenamflags=`echo 'print-runtestflags: ; @echo $(AM_RUNTESTFLAGS)' \| ${MAKE} -s -f Makefile -f - print-runtestflags`fiecho "(cd $dir && runtest $amflags --tool $base $flags)"if test -z "$dry"; theneval runtest --tool $base $flags || st=$?ficd "$cwd"fidoneexit $st
