]> arthur.barton.de Git - ngircd-alex.git/blob - src/testsuite/wait-tests.sh
Two new scripts: test-loop.sh and wait-tests.sh
[ngircd-alex.git] / src / testsuite / wait-tests.sh
1 #!/bin/sh
2 #
3 # ngIRCd Test Suite
4 # Copyright (c)2002-2004 by Alexander Barton (alex@barton.de)
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 # Please read the file COPYING, README and AUTHORS for more information.
11 #
12 # $Id: wait-tests.sh,v 1.1 2004/09/04 15:44:45 alex Exp $
13 #
14
15 [ "$1" -gt 0 ] 2> /dev/null && MAX="$1" || MAX=5
16
17 msg=0
18 while true; do
19   count=`ps | grep "expect " | wc -l`
20   count=`expr $count - 1`
21
22   [ $count -le $MAX ] && break
23
24   if [ $msg -lt 1 ]; then
25     echo -n "      waiting for test scripts to settle: "
26     msg=1
27   fi
28
29   # there are still clients connected. Wait ...
30   echo -n "$count>$MAX "
31   sleep 1
32 done
33
34 [ $msg -gt 0 ] && echo "done: $count"
35 exit 0
36
37 # -eof-