]> git.sur5r.net Git - openldap/blob - tests/run.in
c67665efcf1609250790d5121a7ba6d826adc0e3
[openldap] / tests / run.in
1 #!/bin/sh
2
3 USAGE="$0 [-d <db>] <script>"
4
5 # configure generated
6 SRCDIR=@srcdir@
7 AC_BDB=@BUILD_BDB@
8 AC_HDB=@BUILD_HDB@
9 AC_LDBM=@BUILD_LDBM@
10 AC_MONITOR=@BUILD_MONITOR@
11 AC_CACHE=@BUILD_CACHE@
12 AC_WITH_TLS=@WITH_TLS@
13
14 if test $AC_BDB = yes ; then
15         BACKEND=bdb
16 elif test $AC_LDBM = yes ; then
17         BACKEND=ldbm
18 elif test $AC_HDB = yes ; then
19         BACKEND=hdbm
20 else
21         echo "Not configured with a suitable database backend"
22         exit 1
23 fi
24
25 while test $# -gt 0 ; do
26         case "$1" in
27                 -d | -database)
28                         $BACKEND="$2"
29                         shift; shift ;;
30
31                 -)
32                         shift
33                         break ;;
34
35                 -*)
36                         echo "$USAGE"; exit 1
37                         ;;
38
39                 *)
40                         break ;;
41         esac
42 done
43
44 if test $# != 1 ; then
45         echo "$USAGE"; exit 1
46 fi
47 SCRIPT="${SRCDIR}/scripts/$1"
48
49 if test ! -x "${SCRIPT}" ; then
50         echo "run: ${SCRIPT} not found (or not executable)"
51         exit 1;
52 fi
53
54 echo "Running ${SCRIPT}..."
55 $SCRIPT
56 exit 0