]> git.sommitrealweird.co.uk Git - onak.git/blob - runtests
Start pulling non-library material out of core source files
[onak.git] / runtests
1 #!/bin/sh
2 set -e
3
4 fail=0
5 total=0
6
7 if [ ! -e onak ]; then
8         echo "** onak binary doesn't exist, cannot run test suite" >&2
9         exit 1
10 fi
11
12 if [ -e t/db/ ]; then
13         rm -rf t/db/
14 fi
15
16 for t in libkeydb_*.so; do
17         backend=${t##libkeydb_}
18         backend=${backend%%.so}
19         if [ "`echo t/$backend-*`" != "t/$backend-*" ]; then
20                 echo "* testing $backend backend"
21                 (sed -e "s;DIR;`pwd`;" t/test-in.conf ; \
22                         echo db_backend $backend) > t/test.conf
23                 for t in t/$backend-*.t t/all-*.t; do
24                         total=`expr $total + 1`
25                         mkdir t/db/
26                         if ! $t $backend; then
27                                 echo "test $t failed" >&2
28                                 fail=`expr $fail + 1`
29                         fi
30                         rm -rf t/db/
31                 done
32                 rm t/test.conf
33         fi
34 done
35
36 if [ "$fail" -gt 0 ]; then
37         echo "** failed $fail/$total tests" >&2
38         exit 1
39 else
40         echo "** all tests succeeded"
41 fi