]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/all
ITS#5086
[openldap] / tests / scripts / all
index 2af48bcc4d88084e6107ebec498c5417bcd33b24..3e8c80886f41cc0dd16b531fdd71389086144e80 100755 (executable)
@@ -1,29 +1,49 @@
-#!/bin/sh
+#! /bin/sh
+# $OpenLDAP$
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
+## Copyright 1998-2007 The OpenLDAP Foundation.
+## All rights reserved.
+##
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted only as authorized by the OpenLDAP
+## Public License.
+##
+## A copy of this license is available in the file LICENSE in the
+## top-level directory of the distribution or, alternatively, at
+## <http://www.OpenLDAP.org/license.html>.
 
-# disable LDAP initialization
-LDAPNOINIT=true; export LDAPNOINIT
+. $SRCDIR/scripts/defines.sh
 
-echo ">>>>> Executing all LDAP tests..."
-
-if [ $# -eq 0 ]; then
-       SRCDIR="."
-else
-       SRCDIR=$1; shift
+TB="" TN=""
+if test -t 1 ; then
+       TB=`$SHTOOL echo -e "%B" 2>/dev/null`
+       TN=`$SHTOOL echo -e "%b" 2>/dev/null`
 fi
 
-echo ">>>>> Test Directory: $SRCDIR"
+SLEEPTIME=10
+
+echo ">>>>> Executing all LDAP tests for $BACKEND"
 
 for CMD in $SRCDIR/scripts/test*; do
-       echo ">>>>> Starting `basename $CMD` ..."
-       $CMD $SRCDIR
+       # remove cruft from prior test
+       if test $PRESERVE = yes ; then
+               /bin/rm -rf $TESTDIR/db.*
+       else
+               /bin/rm -rf $TESTDIR
+       fi
+
+       echo ">>>>> Starting ${TB}`basename $CMD`${TN} ..."
+       $CMD
        RC=$?
-       if [ $RC -eq 0 ]; then
-               echo ">>>>> $CMD completed OK."
+       if test $RC -eq 0 ; then
+               echo ">>>>> $CMD completed ${TB}OK${TN}."
        else
-               echo ">>>>> $CMD failed (exit $RC)"
+               echo ">>>>> $CMD ${TB}failed${TN} (exit $RC)"
                exit $RC
        fi
-       echo ">>>>> waiting 5 seconds for things to exit"
-       sleep 5
-       echo
+
+#      echo ">>>>> waiting $SLEEPTIME seconds for things to exit"
+#      sleep $SLEEPTIME
+       echo ""
 done