shadow
reg
socket
+t1
+t2
+.libs
+.deps
-# $Id: Makefile.am,v 1.2 2003-10-20 18:56:00 adam Exp $
+# $Id: Makefile.am,v 1.3 2004-12-02 12:04:49 adam Exp $
-check_SCRIPTS = test1.sh test2.sh
+check_PROGRAMS = t1 t2
-TESTS = $(check_SCRIPTS)
+TESTS = $(check_PROGRAMS)
+
+EXTRA_DIST = zebra.cfg record.abs m1.xml m2.xml m3.xml sample-marc
+
+t1_SOURCES = t1.c
+t2_SOURCES = t2.c
+
+AM_CPPFLAGS = -I$(top_srcdir)/include $(YAZINC)
+
+zebralibs = \
+ ../../index/libidzebra-api.la \
+ ../../rset/libidzebra-rset.la \
+ ../../recctrl/libidzebra-recctrl.la \
+ ../../dict/libidzebra-dict.la \
+ ../../isams/libidzebra-isams.la \
+ ../../isamc/libidzebra-isamc.la \
+ ../../isamb/libidzebra-isamb.la \
+ ../../data1/libidzebra-data1.la \
+ ../../bfile/libidzebra-bfile.la \
+ ../../dfa/libidzebra-dfa.la \
+ ../../util/libidzebra-util.la
+
+LDADD = ../api/libtestlib.a $(zebralibs) $(YAZLALIB)
-EXTRA_DIST = zebra.cfg record.abs m1.xml m2.xml m3.xml sample-marc \
- $(check_SCRIPTS)
-# $Id: record.abs,v 1.4 2004-08-24 14:29:09 adam Exp $
+# $Id: record.abs,v 1.5 2004-12-02 12:04:49 adam Exp $
name marcxml
attset bib1.att
xelm /record/controlfield[@tag="008"] Code-Language:w
xelm /record/datafield[@tag="100"]/subfield[@code="a"] author:w,author:s
xelm /record/datafield[@tag="245"]/subfield title:w
+xelm /record/datafield[@tag="650"] subject-heading:w,subject-heading:p
--- /dev/null
+/* $Id: t1.c,v 1.1 2004-12-02 12:04:49 adam Exp $
+ Copyright (C) 2003,2004
+ Index Data Aps
+
+This file is part of the Zebra server.
+
+Zebra is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Zebra; see the file LICENSE.zebra. If not, write to the
+Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.
+*/
+
+#include "../api/testlib.h"
+
+int main(int argc, char **argv)
+{
+ ZebraService zs = start_up(0, argc, argv);
+ ZebraHandle zh = zebra_open(zs);
+
+ zebra_select_database(zh, "Default");
+
+ zebra_init(zh);
+
+ zebra_begin_trans(zh, 1);
+ zebra_repository_update(zh, "m1.xml");
+ zebra_repository_update(zh, "m2.xml");
+ zebra_repository_update(zh, "m3.xml");
+ zebra_end_trans(zh);
+ zebra_commit(zh);
+
+ do_query(__LINE__,zh, "@and @attr 1=54 eng @and @attr 1=1003 jack @attr 1=4 computer", 2);
+
+ return close_down(zh, zs, 0);
+}
--- /dev/null
+/* $Id: t2.c,v 1.1 2004-12-02 12:04:49 adam Exp $
+ Copyright (C) 2003,2004
+ Index Data Aps
+
+This file is part of the Zebra server.
+
+Zebra is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Zebra; see the file LICENSE.zebra. If not, write to the
+Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.
+*/
+
+#include "../api/testlib.h"
+
+int main(int argc, char **argv)
+{
+ ZebraService zs = start_up(0, argc, argv);
+ ZebraHandle zh = zebra_open(zs);
+
+ zebra_select_database(zh, "Default");
+
+ zebra_init(zh);
+
+ zebra_set_resource(zh, "recordType", "grs.marcxml.record");
+
+ zebra_begin_trans(zh, 1);
+ zebra_repository_update(zh, "sample-marc");
+ zebra_end_trans(zh);
+ zebra_commit(zh);
+
+ do_query(__LINE__,zh, "@and @attr 1=1003 jack @attr 1=4 computer", 2);
+
+ return close_down(zh, zs, 0);
+}
+++ /dev/null
-#!/bin/sh
-# $Id: test1.sh,v 1.6 2004-09-27 10:44:51 adam Exp $
-
-pp=${srcdir:-"."}
-
-LOG=test1.log
-DBG="-v 1647"
-
-rm -f $LOG
-if ../../index/zebraidx -c $pp/zebra.cfg -l $LOG filters|grep grs.xml >/dev/null; then
- ../../index/zebraidx -c $pp/zebra.cfg -l $LOG $DBG init
-else
- exit 0
-fi
-../../index/zebraidx -c $pp/zebra.cfg -l $LOG $DBG update $pp/m*.xml
-../../index/zebrasrv -c $pp/zebra.cfg -l $LOG $DBG unix:socket &
-sleep 1
-../api/testclient unix:socket '@and @attr 1=54 eng @and @attr 1=1003 jack @attr 1=4 computer' >tmp1
-echo 'Result count: 2' >tmp2
-kill `cat zebrasrv.pid` || exit 1
-diff tmp1 tmp2 || exit 2
-rm -f tmp1 tmp2
+++ /dev/null
-#!/bin/sh
-# $Id: test2.sh,v 1.4 2004-09-27 10:44:51 adam Exp $
-
-pp=${srcdir:-"."}
-
-LOG=test2.log
-rm -f $LOG
-
-if ../../index/zebraidx -c $pp/zebra.cfg -l $LOG filters|grep grs.marcxml >/dev/null ; then
- ../../index/zebraidx -c $pp/zebra.cfg -l $LOG $DBG init
-else
- exit 0
-fi
-
-../../index/zebraidx -c $pp/zebra.cfg -l$LOG -t grs.marcxml.record update $pp/sample-marc
-../../index/zebrasrv -c $pp/zebra.cfg -l$LOG unix:socket &
-sleep 1
-../api/testclient unix:socket '@and @attr 1=1003 jack @attr 1=4 computer' >tmp1
-echo 'Result count: 2' >tmp2
-kill `cat zebrasrv.pid` || exit 1
-diff tmp1 tmp2 || exit 2
-rm -f tmp1 tmp2