########################################################################
# #
# This software is part of the ast package #
# Copyright (c) 1994-2011 AT&T Intellectual Property #
# and is licensed under the #
# Eclipse Public License, Version 1.0 #
# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# (with md5 checksum b35adb5213ca9657e911e9befb180842) #
# #
# Information and Software Systems Research #
# AT&T Research #
# Florham Park NJ #
# #
# Glenn Fowler <gsf@research.att.com> #
# #
########################################################################
command=rt
flags='--silent --keepgoing'
failed=0
heading=1
verbose=0
USAGE=$'
[-?
@(#)$Id: rt (AT&T Research) 2010-07-27 $
]
[+NAME?rt - run "nmake test" and filter output]
[+DESCRIPTION?\brt\b runs \vnmake test\v and filters the regression
test output to contain only test summary lines. If no \atest\a
operands are specified then \btest\b is assumed. If \b-\b is
specified then the \afile\a operands, or the standard input
if no \afile\a operands are specified, are filtered instead
of the output from \bnmake\b.]
[f:failed?Only list failed test results.]
[h!:heading?Enable per-file heading when more than one \afile\a operand
follows \b-\b.]
[v:verbose?Run with \vREGRESSFLAGS=-v\v.]
[ test ... | - [ file ... ] ]
[+SEE ALSO?\bnmake\b(1), \bregress\b(1)]
[+CAVEATS?\brt\b guesses the regression test output style. Garbled
output indicates a bad guess.]
'
;;
*) ARGV0=""
USAGE="fhv"
;;
esac
function usage
{
OPTIND=0
exit 2
}
f) failed=1 ;;
h) heading=0 ;;
esac
done
set -o noglob
dots='............................................'
bad=' ***'
typeset -l lower
{
integer t=$1 e=$2 s=$3
then print -r -n -- "$unit"
fi
if (( t >= 0 ))
then if (( t == 1))
then label="test "
fi
fi
if (( s ))
(( e=s ))
fi
if (( e != 1))
fi
if (( e == 1 ))
elif (( e > 1 ))
fi
fi
fi
}
function unit
{
typeset x
if [[ $component ]]
then x=${component##*/}
then if [[ $component == cmd/?*lib/* ]]
fi
fi
fi
if [[ $1 ]]
fi
then print -r -n -- "$unit"
fi
}
if [[ $1 == - ]]
then shift
if (( $# <= 1 ))
then heading=0
fi
then for i
do print test heading $i
cat -- "$i"
done
else cat "$@"
fi
else if [[ $1 == *=* ]]
then set test "$@"
elif (( ! $# ))
then set test
fi
fi |
while read -r line
do set '' $line
shift
set '' $line
set '' $*
while :
do case $2 in
'') break
;;
errors=$1
break
;;
test|tests)
tests=$1
;;
esac
shift
done
continue
;;
TEST[' ']*)
set '' $line
set '' $*
case $4 in
esac
errors=0
signals=0
continue
;;
'pathname and options of item under test')
read -r line || break
set '' $line
tests=0
errors=0
signals=0
continue
;;
'test heading '*)
then print
else heading=2
fi
set '' $line
shift 3
print -r -- "==> $* <=="
fi
continue
;;
'test '*' begins at '????-??-??+??:??:??|'test '*' begins at '*' '*' '*' '*' '*)
tests=-1
errors=0
signals=0
continue
;;
'test '*' at '????-??-??+??:??:??' [ '*' ]'|'test '*' at '*' '*' '*' '*' '*)
while :
do case $1 in
errors=$4
fi
break
;;
esac
shift
done
;;
while :
do case $1 in
signals=$4
fi
break
;;
esac
shift
done
;;
*) if [[ $3 != passed ]]
fi
;;
esac
continue
;;
'## ---'*(-)'--- ##')
read -r line || break
set '' $lower
'##'*'test suite:'*'##')
set -- ${*//[.#]/}
unit=$*
if [[ $unit == *' tests' ]]
fi
tests=0
errors=0
signals=0
continue
;;
esac
;;
regress) continue ;;
esac
read -r line || break
set '' $line
'Running tests for '*)
shift 4
unit=
while (( $# ))
do if [[ $1 == on ]]
then break
fi
if [[ $unit ]]
fi
shift
done
tests=-1
errors=-1
continue
;;
tests=0
errors=0
signals=0
continue
;;
esac
;;
;;
;;
esac
;;
esac
;;
*': warning:'*|*'making test'*|*'action'?(s)' failed'*|*': *** '*)
;;
;;
esac
continue
;;
;;
'') continue
;;
esac
+([0-9]):*ok)
;;
+([0-9]):*FAILED*)
then if [[ ! $prefix ]]
print
fi
print -r -- " ${line//*'FAILED '/}"
fi
;;
esac
continue
;;
*'........ '*)
if [[ $1 == */* ]]
then cat=${1%%/*}
tests=0
errors=0
signals=0
fi
*' ok') ;;
then if [[ ! $prefix ]]
print
fi
print -r -- "$line"
fi
;;
esac
*) errors=1 ;;
esac
print
shift 2
print -r -- "$@"
else prefix=
fi
tests=-1
errors=-1
fi
;;
esac
continue
;;
esac
;;
['<>']*);;
*) continue ;;
esac
;;
script) continue
;;
;;
continue
;;
unknown)continue
;;
esac
;;
esac
then if [[ ! $prefix ]]
print
fi
print -r -- "$line"
fi
done