3 # Copyright (C) 2000, 2001, 2002, 2004, 2005, 2011, 2012 Niels Möller
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License along
16 # with this program; if not, write to the Free Software Foundation, Inc.,
17 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 if [ -z "$srcdir" ] ; then
31 # When used in make rules, we sometimes get the filenames VPATH
32 # expanded, but usually not.
50 if "$1"; then : ; else
58 testname
=`basename "$1" .exe`
59 testname
=`basename "$testname" -test`
60 if [ -z "$EMULATOR" ] ||
head -1 "$1" |
grep '^#!' > /dev
/null
; then
63 $EMULATOR "$1" $testflags
75 failed
=`expr $failed + 1`
81 env_program
`find_program setup-env`
93 echo >&2 'Unknown option `'"$1'"
103 if [ $# -eq 0 ] ; then
104 for f
in *-test; do test_program
"./$f"; done
106 for f
in "$@" ; do test_program
`find_program "$f"`; done
109 if [ $failed -eq 0 ] ; then
110 banner="All $all tests passed"
112 banner="$failed of $all tests failed"
114 dashes
=`echo "$banner" | sed s/./=/g`
119 if [ "x$debug" = xno
] ; then
120 env_program
`find_program teardown-env`