From 285276d2e61111c371c8ed9f8c37e8a7eaf7c39d Mon Sep 17 00:00:00 2001 From: Heikki Levanto Date: Fri, 4 Jul 2003 14:25:51 +0000 Subject: [PATCH] Added zebrash test --- configure.in | 4 ++-- index/zebrash.c | 14 +++++++++++++- test/Makefile.am | 2 +- test/zsh/Makefile.am | 13 +++++++++++++ test/zsh/testall.sh | 23 +++++++++++++++++++++++ 5 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 test/zsh/Makefile.am create mode 100755 test/zsh/testall.sh diff --git a/configure.in b/configure.in index 0c7ac56..abae2c7 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl Zebra, Index Data Aps, 1995-2003 -dnl $Id: configure.in,v 1.80 2003-06-12 18:20:33 adam Exp $ +dnl $Id: configure.in,v 1.81 2003-07-04 14:25:51 heikki Exp $ dnl AC_INIT(include/zebraver.h) AM_INIT_AUTOMAKE(idzebra,1.3.12) @@ -393,7 +393,7 @@ AC_OUTPUT([ test/Makefile test/gils/Makefile test/usmarc/Makefile test/api/Makefile test/rusmarc/Makefile test/cddb/Makefile perl/Makefile.PL test/xelm/Makefile - test/dmoz/Makefile test/xpath/Makefile test/sort/Makefile + test/dmoz/Makefile test/xpath/Makefile test/sort/Makefile test/zsh/Makefile examples/Makefile examples/gils/Makefile examples/zthes/Makefile idzebra.spec ]) diff --git a/index/zebrash.c b/index/zebrash.c index f88ce45..84799bf 100644 --- a/index/zebrash.c +++ b/index/zebrash.c @@ -1,4 +1,4 @@ -/* $Id: zebrash.c,v 1.17 2003-07-04 14:00:22 heikki Exp $ +/* $Id: zebrash.c,v 1.18 2003-07-04 14:25:51 heikki Exp $ Copyright (C) 2002,2003 Index Data Aps @@ -133,6 +133,16 @@ int cmd_echo( char *args[], WRBUF outbuff) int cmd_quit( char *args[], WRBUF outbuff) { + if (zs) + { + onecommand("zebra_close",outbuff,""); + zs=0; + } + if (zh) + { + onecommand("zebra_stop",outbuff,""); + zh=0; + } wrbuf_puts(outbuff, "bye"); return -99; /* special stop signal */ } @@ -438,6 +448,7 @@ static int cmd_show( char *args[], WRBUF outbuff) } nextrecno=start+nrecs+1; } + odr_destroy(odr); return rc; } /**************************************) @@ -736,6 +747,7 @@ void shell() Zerrors(outbuff); printf("%s\n", wrbuf_buf(outbuff)); } /* while */ + wrbuf_free(outbuff,1); } /* shell() */ diff --git a/test/Makefile.am b/test/Makefile.am index 71221c3..4796200 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,3 +1,3 @@ -SUBDIRS=api gils usmarc dmoz xpath sort xelm cddb rusmarc +SUBDIRS=api gils usmarc dmoz xpath sort xelm cddb rusmarc zsh diff --git a/test/zsh/Makefile.am b/test/zsh/Makefile.am new file mode 100644 index 0000000..ce41508 --- /dev/null +++ b/test/zsh/Makefile.am @@ -0,0 +1,13 @@ +# $Id: Makefile.am,v 1.1 2003-07-04 14:25:51 heikki Exp $ + +#dist-hook: +# -mkdir $(distdir)/records +# cp $(srcdir)/records/*.grs $(distdir)/records + + +check_SCRIPTS = testall.sh + +TESTS = testall.sh + +EXTRA_DIST = test1.zsh zebra.cfg + diff --git a/test/zsh/testall.sh b/test/zsh/testall.sh new file mode 100755 index 0000000..d5670d6 --- /dev/null +++ b/test/zsh/testall.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# run all zebrash tests +mkdir -p reg +rm -f *.mf reg/*.mf *.out + +for F in *.zsh +do + echo $F + ../../index/zebrash <$F >$F.out + RC=$? + if [ "$RC" -gt "0" ] + then + echo "$F failed with exit code $RC" + FINAL=$RC + fi +done +if [ "$FINAL" ] +then + echo "Tests FAILED" + exit 9 +fi +echo OK +exit 0 -- 1.7.10.4