Pazpar2 1.4.4-2 for squeeze
[pazpar2-moved-to-github.git] / test / test_facets.sh
1 #!/bin/sh
2
3 # srcdir might be set by make
4 srcdir=${srcdir:-"."}
5
6 # look for yaz-ztest in PATH
7 oIFS=$IFS
8 IFS=:
9 F=''
10 for p in $PATH; do
11     if test -x $p/yaz-ztest -a -x $p/yaz-config; then
12         VERSION=`$p/yaz-config -V|awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
13         if test $VERSION -ge 4000012; then
14             F=$p/yaz-ztest
15             break
16         fi
17     fi
18 done
19 IFS=$oIFS
20
21 if test -z "$F"; then
22    echo "yaz-ztest not found that supports facets"
23    exit 0
24 fi
25
26 rm -f ztest.pid
27 $F -l ztest.log -p ztest.pid -D @:9999
28 sleep 1
29 if test ! -f ztest.pid; then
30     echo "yaz-ztest could not be started"
31     exit 0
32 fi
33
34 ${srcdir}/run_pazpar2.sh test_facets
35 E=$?
36
37 kill `cat ztest.pid`
38 rm ztest.pid
39 exit $E
40
41 # Local Variables:
42 # mode:shell-script
43 # sh-indentation: 2
44 # sh-basic-offset: 4
45 # End: