Add test case for test/rusmarc
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 9 Mar 2004 18:45:17 +0000 (18:45 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 9 Mar 2004 18:45:17 +0000 (18:45 +0000)
test/rusmarc/Makefile.am
test/rusmarc/test.sh
test/rusmarc/test1.sh [new file with mode: 0755]

index 536c203..4b01e59 100644 (file)
@@ -1,5 +1,10 @@
+# $Id: Makefile.am,v 1.3 2004-03-09 18:45:17 adam Exp $
 
-EXTRA_DIST = zebra.cfg test.sh
+check_SCRIPTS = test1.sh
+
+TESTS = $(check_SCRIPTS)
+
+EXTRA_DIST = zebra.cfg test.sh $(check_SCRIPTS)
 
 dist-hook:
        mkdir -p $(distdir)/records
index c924b19..6003151 100755 (executable)
@@ -1,12 +1,12 @@
 #!/bin/sh
-# $Id: test.sh,v 1.3 2003-05-06 17:39:01 adam Exp $
+# $Id: test.sh,v 1.4 2004-03-09 18:45:17 adam Exp $
 test -d tmp || mkdir tmp
 test -d lock || mkdir lock
 test -d register || mkdir register
 
 echo Loading Records
 if [ -x ../../index/zebraidx ]; then
-       ../../index/zebraidx update records
+       ../../index/zebraidx update records/simple-rusmarc
 fi
 echo Starting Server
 if [ -x ../../index/zebrasrv ]; then
diff --git a/test/rusmarc/test1.sh b/test/rusmarc/test1.sh
new file mode 100755 (executable)
index 0000000..4566ebb
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+# $Id: test1.sh,v 1.1 2004-03-09 18:45:17 adam Exp $
+LOG=test1.log
+rm -f $LOG
+../../index/zebraidx -l$LOG init
+../../index/zebraidx -l$LOG update records/*marc
+../../index/zebrasrv -l$LOG unix:socket &
+sleep 1
+# search text located in first record 600 $a
+# term is koi8-r encoded
+../api/testclient unix:socket '@attr 1=21 úÁÍÑÔÉÎ' >tmp1
+echo 'Result count: 1' >tmp2
+kill `cat lock/zebrasrv.pid` || exit 1
+diff tmp1 tmp2 || exit 2
+rm -f tmp1 tmp2