Blame


1 7ec11de5 2004-09-04 alex #!/bin/sh
2 7ec11de5 2004-09-04 alex #
3 7ec11de5 2004-09-04 alex # ngIRCd Test Suite
4 7ec11de5 2004-09-04 alex # Copyright (c)2002-2004 by Alexander Barton (alex@barton.de)
5 7ec11de5 2004-09-04 alex #
6 7ec11de5 2004-09-04 alex # This program is free software; you can redistribute it and/or modify
7 7ec11de5 2004-09-04 alex # it under the terms of the GNU General Public License as published by
8 7ec11de5 2004-09-04 alex # the Free Software Foundation; either version 2 of the License, or
9 7ec11de5 2004-09-04 alex # (at your option) any later version.
10 7ec11de5 2004-09-04 alex # Please read the file COPYING, README and AUTHORS for more information.
11 7ec11de5 2004-09-04 alex #
12 c5bdd86f 2004-09-04 alex # $Id: test-loop.sh,v 1.2 2004/09/04 19:14:46 alex Exp $
13 7ec11de5 2004-09-04 alex #
14 7ec11de5 2004-09-04 alex
15 7ec11de5 2004-09-04 alex # detect source directory
16 7ec11de5 2004-09-04 alex [ -z "$srcdir" ] && srcdir=`dirname $0`
17 7ec11de5 2004-09-04 alex
18 7ec11de5 2004-09-04 alex # parse command line
19 7ec11de5 2004-09-04 alex [ "$1" -gt 0 ] 2> /dev/null && LOOPS="$1" || LOOPS=5
20 7ec11de5 2004-09-04 alex [ "$2" -gt 0 ] 2> /dev/null && WAIT="$2" || WAIT=5
21 7ec11de5 2004-09-04 alex
22 7ec11de5 2004-09-04 alex loop=0
23 7ec11de5 2004-09-04 alex while [ ${loop} -lt $LOOPS ]; do
24 7ec11de5 2004-09-04 alex loop=`expr ${loop} + 1`
25 c5bdd86f 2004-09-04 alex echo " loop $loop/$LOOPS starting:"
26 7ec11de5 2004-09-04 alex for s in $srcdir/*-test; do
27 c5bdd86f 2004-09-04 alex sh $s; r=$?
28 c5bdd86f 2004-09-04 alex [ $r -ne 0 ] && exit $r
29 7ec11de5 2004-09-04 alex sleep 1
30 7ec11de5 2004-09-04 alex done
31 7ec11de5 2004-09-04 alex if [ ${loop} -lt $LOOPS ]; then
32 7ec11de5 2004-09-04 alex echo " waiting $WAIT seconds ..."
33 7ec11de5 2004-09-04 alex sleep $WAIT
34 7ec11de5 2004-09-04 alex fi
35 7ec11de5 2004-09-04 alex done
36 7ec11de5 2004-09-04 alex
37 7ec11de5 2004-09-04 alex # -eof-