4 # Work out where everything is
6 # Binary should be in current directory
8 echo "** onak binary doesn't exist, cannot run test suite" >&2
13 # Tests live in the t/ dir underneath where this script is
14 TESTSDIR=$(dirname $(readlink -f "$0"))/t
16 # We create a temporary directory to work in
17 WORKDIR=$(mktemp -d -t onak-test.XXXXXXXX)
23 export BUILDDIR TESTSDIR WORKDIR
25 echo "BUILDDIR: ${BUILDDIR}"
26 echo "TESTSDIR: ${TESTSDIR}"
27 echo "WORKDIR : ${WORKDIR}"
32 for t in keydb/libkeydb_*.so; do
33 backend=${t##keydb/libkeydb_}
34 backend=${backend%%.so}
35 if [ "`echo ${TESTSDIR}/$backend-*`" != "${TESTSDIR}/$backend-*" ]; then
36 echo "* testing $backend backend"
37 sed -e "s;BUILDDIR;${BUILDDIR};" -e "s;WORKDIR;${WORKDIR};" \
38 -e "s;DB;${backend};" \
39 ${TESTSDIR}/test-in.ini > ${WORKDIR}/test.ini
40 touch ${WORKDIR}/blacklist
41 for t in ${TESTSDIR}/$backend-*.t ${TESTSDIR}/all-*.t; do
42 total=`expr $total + 1`
44 if ! $t ${WORKDIR}/test.ini $backend; then
45 echo "test $t failed" >&2
50 rm ${WORKDIR}/test.ini
54 if [ "$fail" -gt 0 ]; then
55 echo "** failed $fail/$total tests" >&2
58 echo "** all tests succeeded ($total)"