test_facets require YAZ 4.2.68
[pazpar2-moved-to-github.git] / test / test_termlist_block.sh
1 #!/bin/sh
2 #
3
4 # srcdir might be set by make
5 srcdir=${srcdir:-"."}
6
7 TEST=`basename $0 .sh`
8
9 # look for yaz-ztest in PATH
10 oIFS=$IFS
11 IFS=:
12 F=''
13 for p in $PATH; do
14     if test -x $p/yaz-ztest -a -x $p/yaz-client; then
15         VERSION=`$p/yaz-client -V|awk '{print $3;}'|awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
16         if test $VERSION -ge 4002052; then
17             F=$p/yaz-ztest
18             break
19         fi
20     fi
21 done
22 IFS=$oIFS
23
24 if test -z "$F"; then
25     echo "yaz-ztest not found"
26     exit 0
27 fi
28
29 rm -f ztest.pid
30 rm -f ${TEST}_ztest.log
31 $F -l ${TEST}_ztest.log -p ztest.pid -D tcp:localhost:9999
32 sleep 1
33 if test ! -f ztest.pid; then
34     echo "yaz-ztest could not be started"
35     exit 0
36 fi
37
38 E=0
39 if test -x ../src/pazpar2; then
40     if ../src/pazpar2 -V |grep icu:enabled >/dev/null; then
41         ${srcdir}/run_pazpar2.sh $TEST
42         E=$?
43     fi
44 fi
45
46 kill `cat ztest.pid`
47 rm ztest.pid
48 exit $E
49
50 # Local Variables:
51 # mode:shell-script
52 # sh-indentation: 2
53 # sh-basic-offset: 4
54 # End: