dnl Zebra, Index Data Aps, 1995-2002
-dnl $Id: configure.in,v 1.54 2002-11-08 19:59:52 adam Exp $
+dnl $Id: configure.in,v 1.55 2002-11-09 22:26:19 adam Exp $
dnl
AC_INIT(include/zebraver.h)
AM_INIT_AUTOMAKE(idzebra,1.3.3)
doc/zebraphp.dsl
doc/tkl.xsl
test/Makefile test/gils/Makefile test/usmarc/Makefile test/api/Makefile
- test/dmoz/Makefile
+ test/dmoz/Makefile test/xpath/Makefile
examples/Makefile examples/gils/Makefile
])
-SUBDIRS=gils usmarc api dmoz
+SUBDIRS=gils usmarc api dmoz xpath
testclient_SOURCES = testclient.c
/*
- * $Id: testclient.c,v 1.4 2002-10-23 13:55:37 adam Exp $
+ * $Id: testclient.c,v 1.5 2002-11-09 22:26:19 adam Exp $
*
* Z39.50 client specifically for Zebra testing.
*/
int retrieve_offset = 0;
char *format = 0;
int pos;
+ int check_count = -1;
+ int exit_code = 0;
- while ((ret = options("d:n:o:f:", argv, argc, &arg)) != -2)
+ while ((ret = options("d:n:o:f:c:", argv, argc, &arg)) != -2)
{
switch (ret)
{
case 'f':
format = xstrdup(arg);
break;
+ case 'c':
+ check_count = atoi(arg);
+ break;
default:
printf ("%s: unknown option %s\n", prog, arg);
printf ("usage:\n%s [options] target query \n", prog);
r = ZOOM_connection_search_pqf (z, query);
if ((error = ZOOM_connection_error(z, &errmsg, &addinfo)))
- fprintf (stderr, "Error: %s (%d) %s\n", errmsg, error, addinfo);
+ {
+ printf ("Error: %s (%d) %s\n", errmsg, error, addinfo);
+ if (check_count != -1)
+ exit_code = 10;
+ }
else
+ {
printf ("Result count: %d\n", ZOOM_resultset_size(r));
-
+ if (check_count != -1 && check_count != ZOOM_resultset_size(r))
+ exit_code = 10;
+ }
if (format)
ZOOM_resultset_option_set(r, "preferredRecordSyntax", format);
for (pos = 0; pos < retrieve_number; pos++)
--- /dev/null
+Makefile
+Makefile.in
+*.mf
+*.log
+*.tmp
+*.LCK
--- /dev/null
+TESTS = test1.sh test2.sh test3.sh
+
+EXTRA_DIST = $(TESTS) zebra.cfg rec
+
--- /dev/null
+attset bib1.att
+tagset tagsetg.tag
+xpath enable
+
+# elm (2,1) title !
--- /dev/null
+<Zthes>
+ <termId>10</termId>
+ <termName>Sauropoda</termName>
+ <termType>PT</termType>
+ <relation>
+ <relationType>BT</relationType>
+ <termId>5</termId>
+ <termName>Brontosauria</termName>
+ <termType>PT</termType>
+ </relation>
+ <relation>
+ <relationType>NT</relationType>
+ <termId>11</termId>
+ <termName>Eusauropoda</termName>
+ <termType>PT</termType>
+ </relation>
+</Zthes>
+<Zthes>
+ <termId>5</termId>
+ <termName>Brontosauria</termName>
+ <termType>PT</termType>
+ <relation>
+ <relationType>BT</relationType>
+ <termId>4</termId>
+ <termName>Sauropodomorpha</termName>
+ <termType>PT</termType>
+ </relation>
+ <relation>
+ <relationType>NT</relationType>
+ <termId>6</termId>
+ <termName>Plateosauria</termName>
+ <termType>PT</termType>
+ </relation>
+ <relation>
+ <relationType>NT</relationType>
+ <termId>10</termId>
+ <termName>Sauropoda</termName>
+ <termType>PT</termType>
+ </relation>
+</Zthes>
--- /dev/null
+#!/bin/sh
+rm -f test1.log
+../../index/zebraidx -l test1.log init || exit 1
+../../index/zebraidx -l test1.log -t grs.sgml update rec || exit 2
--- /dev/null
+#!/bin/sh
+LOG=test2.log
+TMP=test2.tmp
+rm -f $LOG
+test -f dict*.mf || exit 1
+../../index/zebrasrv -l $LOG -S unix:socket &
+sleep 1
+test -f zebrasrv.pid || exit 2
+../testclient unix:socket '@attr 1=/Zthes/termName Sauropoda' >$TMP
+echo 'Killing server' >>$LOG
+kill `cat zebrasrv.pid` || exit 3
+cat $TMP >>$LOG
+echo 'Checking that result count is 1' >>$LOG
+grep "^Result count: 1$" $TMP || exit 4
+echo 'Test OK' >>$LOG
+
--- /dev/null
+#!/bin/sh
+LOG=test3.log
+TMP=test3.tmp
+rm -f $LOG
+test -f dict*.mf || exit 1
+../../index/zebrasrv -l $LOG -S unix:socket &
+sleep 1
+test -f zebrasrv.pid || exit 2
+../testclient unix:socket '@attr 1=/Zthes/relation/termName Sauropoda' >$TMP
+echo 'Killing server' >>$LOG
+kill `cat zebrasrv.pid` || exit 3
+cat $TMP >>$LOG
+echo 'Checking that result count is 1' >>$LOG
+grep "^Result count: 1$" $TMP >/dev/null || exit 4
+echo 'Test OK' >>$LOG
+
--- /dev/null
+# $Id: zebra.cfg,v 1.1 2002-11-09 22:26:19 adam Exp $
+profilePath: .:../../tab
+recordType: grs.sgml
+attset: bib1.att