the new makeinfo sets the FLOAT_NAME by default.
[gnutls.git] / tests / scripts / common.sh
blob80a4dfedaf83c3557fee5253eb0a2cef33763a63
1 # Copyright (C) 2011-2012 Free Software Foundation, Inc.
3 # This file is part of GnuTLS.
5 # The launch_server() function was contributed by Cedric Arbogast.
7 # This file is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # This file is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this file; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 fail() {
22 PID=$1
23 shift;
24 echo "Failure: $1" >&2
25 kill $PID
26 exit 1
29 launch_server() {
30 PARENT=$1;
31 shift;
32 $SERV $DEBUG -p $PORT $* >/dev/null 2>&1 &
33 LOCALPID="$!";
34 trap "[ ! -z \"${LOCALPID}\" ] && kill ${LOCALPID};" 15
35 wait "${LOCALPID}"
36 LOCALRET="$?"
37 if [ "${LOCALRET}" != "0" ] && [ "${LOCALRET}" != "143" ] ; then
38 # Houston, we'v got a problem...
39 echo "Failed to launch a gnutls-serv server !"
40 kill -10 ${PARENT}
44 launch_bare_server() {
45 PARENT=$1;
46 shift;
47 $SERV $* >/dev/null 2>&1 &
48 LOCALPID="$!";
49 trap "[ ! -z \"${LOCALPID}\" ] && kill ${LOCALPID};" 15
50 wait "${LOCALPID}"
51 LOCALRET="$?"
52 if [ "${LOCALRET}" != "0" ] && [ "${LOCALRET}" != "143" ] ; then
53 # Houston, we'v got a problem...
54 echo "Failed to launch server !"
55 kill -10 ${PARENT}
59 wait_server() {
60 trap "kill $1" 1 15 2
61 sleep 2
64 trap "fail \"Failed to launch a gnutls-serv server, aborting test... \"" 10