From 6c5eead59b04271013219c4e71b3a1314ced4957 Mon Sep 17 00:00:00 2001 From: Marc Cromme Date: Thu, 27 Apr 2006 10:52:26 +0000 Subject: [PATCH] bypassing checks when running make distcheck --- test/gils/Makefile.am | 4 +-- test/gils/cleanrecords.sh | 14 ++++++++++ test/gils/stop01.sh | 16 ++++++++---- test/gils/stop02.sh | 16 ++++++++---- test/gils/stop03.sh | 16 ++++++++---- test/gils/stop04.sh | 16 ++++++++---- test/gils/test1.sh | 32 ++++++++++++++++++----- test/gils/test2.sh | 47 +++++++++++++++++++-------------- test/gils/test3.sh | 19 ++++++++++---- test/gils/timing1.sh | 64 ++++++++++++++++++++++++++------------------- test/gils/timing2.sh | 40 ++++++++++++++++------------ test/zsh/testall.sh | 20 +++++++++----- 12 files changed, 201 insertions(+), 103 deletions(-) create mode 100755 test/gils/cleanrecords.sh diff --git a/test/gils/Makefile.am b/test/gils/Makefile.am index a1fa604..0c5b962 100644 --- a/test/gils/Makefile.am +++ b/test/gils/Makefile.am @@ -1,4 +1,4 @@ -# $Id: Makefile.am,v 1.17 2004-01-30 11:43:41 heikki Exp $ +# $Id: Makefile.am,v 1.18 2006-04-27 10:52:26 marc Exp $ dist-hook: -mkdir $(distdir)/records @@ -9,4 +9,4 @@ check_SCRIPTS = stop01.sh stop02.sh stop03.sh stop04.sh \ TESTS = $(check_SCRIPTS) -EXTRA_DIST = zebra1.cfg zebra2.cfg $(check_SCRIPTS) +EXTRA_DIST = cleanrecords.sh zebra1.cfg zebra2.cfg $(check_SCRIPTS) diff --git a/test/gils/cleanrecords.sh b/test/gils/cleanrecords.sh new file mode 100755 index 0000000..7413e0a --- /dev/null +++ b/test/gils/cleanrecords.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# $Id: cleanrecords.sh,v 1.1 2006-04-27 10:52:26 marc Exp $ + +srcdir=${srcdir:-"."} + +# these should not be here, will be created later +if [ -f $srcdir/records/esdd0001.grs ] + then + rm -f $srcdir/records/esdd0001.grs +fi +if [ -f $srcdir/records/esdd0002.grs ] + then + rm -f $srcdir/records/esdd0002.grs +fi diff --git a/test/gils/stop01.sh b/test/gils/stop01.sh index 97083b5..5b33d33 100755 --- a/test/gils/stop01.sh +++ b/test/gils/stop01.sh @@ -1,21 +1,27 @@ #!/bin/sh -# $Id: stop01.sh,v 1.11 2005-01-03 09:19:26 adam Exp $ +# $Id: stop01.sh,v 1.12 2006-04-27 10:52:26 marc Exp $ # test start and stop of the server with -1 -pp=${srcdir:-"."} +srcdir=${srcdir:-"."} + +if [ "$srcdir" != "." ] + then + echo "Jumping over test" + exit 0 +fi LOG=stop01.log rm -f $LOG echo "initializing" >>$LOG test -d reg || mkdir reg -../../index/zebraidx -l $LOG -c $pp/zebra1.cfg init || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg init || exit 1 #create a base to test on -../../index/zebraidx -l $LOG -c $pp/zebra1.cfg update records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg update records || exit 1 echo "Starting server with -1 (one shot)..." >>$LOG -../../index/zebrasrv -D -p z.pid -1 -c $pp/zebra1.cfg -l $LOG unix:socket +../../index/zebrasrv -D -p z.pid -1 -c $srcdir/zebra1.cfg -l $LOG unix:socket echo " checking that it runs... " >>$LOG test -f z.pid || exit 1 PID=`cat z.pid` diff --git a/test/gils/stop02.sh b/test/gils/stop02.sh index 3fc821e..b75a4a6 100755 --- a/test/gils/stop02.sh +++ b/test/gils/stop02.sh @@ -1,21 +1,27 @@ #!/bin/sh -# $Id: stop02.sh,v 1.11 2005-01-03 09:19:26 adam Exp $ +# $Id: stop02.sh,v 1.12 2006-04-27 10:52:26 marc Exp $ # test start and stop of the server with -S -pp=${srcdir:-"."} +srcdir=${srcdir:-"."} + +if [ "$srcdir" != "." ] + then + echo "Jumping over test" + exit 0 +fi LOG=stop02.log rm -f $LOG echo "initializing" >>$LOG test -d reg || mkdir reg -../../index/zebraidx -l $LOG -c $pp/zebra1.cfg init || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg init || exit 1 #create a base to test on -../../index/zebraidx -l $LOG -c $pp/zebra1.cfg update records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg update records || exit 1 echo "Starting server with -S (static)..." >>$LOG -../../index/zebrasrv -D -p z.pid -S -c $pp/zebra1.cfg -l $LOG unix:socket +../../index/zebrasrv -D -p z.pid -S -c $srcdir/zebra1.cfg -l $LOG unix:socket echo " checking that it runs... " >>$LOG test -f z.pid || exit 1 PID=`cat z.pid` diff --git a/test/gils/stop03.sh b/test/gils/stop03.sh index 112471d..9a539a3 100755 --- a/test/gils/stop03.sh +++ b/test/gils/stop03.sh @@ -1,21 +1,27 @@ #!/bin/sh -# $Id: stop03.sh,v 1.11 2005-01-03 12:08:04 adam Exp $ +# $Id: stop03.sh,v 1.12 2006-04-27 10:52:26 marc Exp $ # test start and stop of the threaded server (-T) -pp=${srcdir:-"."} +srcdir=${srcdir:-"."} + +if [ "$srcdir" != "." ] + then + echo "Jumping over test" + exit 0 +fi LOG=stop03.log rm -f $LOG echo "initializing" >>$LOG mkdir -p reg -../../index/zebraidx -l $LOG -c $pp/zebra1.cfg init || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg init || exit 1 #create a base to test on -../../index/zebraidx -l $LOG -c $pp/zebra1.cfg update records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg update records || exit 1 echo "Starting server with -T (threaded)..." >>$LOG -../../index/zebrasrv -D -p z.pid -T -c $pp/zebra1.cfg -l $LOG unix:socket 2>out +../../index/zebrasrv -D -p z.pid -T -c $srcdir/zebra1.cfg -l $LOG unix:socket 2>out if grep 'not available' out >/dev/null; then test -f z.pid && rm -f z.pid diff --git a/test/gils/stop04.sh b/test/gils/stop04.sh index 43f2bd6..cf6f842 100755 --- a/test/gils/stop04.sh +++ b/test/gils/stop04.sh @@ -1,21 +1,27 @@ #!/bin/sh -# $Id: stop04.sh,v 1.10 2005-01-03 12:08:04 adam Exp $ +# $Id: stop04.sh,v 1.11 2006-04-27 10:52:26 marc Exp $ # test start and stop of the forked server -pp=${srcdir:-"."} +srcdir=${srcdir:-"."} + +if [ "$srcdir" != "." ] + then + echo "Jumping over test" + exit 0 +fi LOG=stop04.log rm -f $LOG echo "initializing" >>$LOG mkdir -p reg -../../index/zebraidx -l $LOG -c $pp/zebra1.cfg init || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg init || exit 1 #create a base to test on -../../index/zebraidx -l $LOG -c $pp/zebra1.cfg update records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg update records || exit 1 echo "Starting server with (forked)..." >>$LOG -../../index/zebrasrv -D -p z.pid -c $pp/zebra1.cfg -l $LOG unix:socket +../../index/zebrasrv -D -p z.pid -c $srcdir/zebra1.cfg -l $LOG unix:socket echo " checking that it runs... " >>$LOG test -f z.pid || exit 1 diff --git a/test/gils/test1.sh b/test/gils/test1.sh index 91572cb..4eff517 100755 --- a/test/gils/test1.sh +++ b/test/gils/test1.sh @@ -1,21 +1,39 @@ #!/bin/sh -# $Id: test1.sh,v 1.13 2005-01-03 12:08:04 adam Exp $ +# $Id: test1.sh,v 1.14 2006-04-27 10:52:26 marc Exp $ + +srcdir=${srcdir:-"."} + +if [ "$srcdir" != "." ] + then + echo "Jumping over test" + exit 0 +fi -pp=${srcdir:-"."} LOG=test1.log rm -f $LOG echo "initializing..." >>$LOG test -d reg || mkdir reg -rm -f $pp/records/esdd000[12].grs # these should not be here, will be created later -../../index/zebraidx -l $LOG -c $pp/zebra1.cfg init || exit 1 + +# these should not be here, will be created later +$srcdir/cleanrecords.sh +#if [ -f $srcdir/records/esdd0001.grs ] +# then +# rm -f $srcdir/records/esdd0001.grs +#fi +#if [ -f $srcdir/records/esdd0002.grs ] +# then +# rm -f $srcdir/records/esdd0002.grs +#fi + +../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg init || exit 1 echo "updating..." >>$LOG -../../index/zebraidx -l $LOG -c $pp/zebra1.cfg update $pp/records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg update $srcdir/records || exit 1 echo "starting server..." >>$LOG -../../index/zebrasrv -D -p z.pid -S -c $pp/zebra1.cfg -l $LOG unix:socket +../../index/zebrasrv -D -p z.pid -S -c $srcdir/zebra1.cfg -l $LOG unix:socket echo "checking it runs..." >>$LOG test -f z.pid || exit 1 @@ -37,7 +55,7 @@ echo "search 4..." >>$LOG grep "^Result count: 9$" log >/dev/null || exit 1 echo "reindexing..." >>$LOG -../../index/zebraidx -l $LOG -c $pp/zebra1.cfg update $pp/records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg update $srcdir/records || exit 1 echo "search 5..." >>$LOG ../api/testclient unix:socket "@attr 1=4 utah" > log || exit 1 diff --git a/test/gils/test2.sh b/test/gils/test2.sh index db2714b..e8af160 100755 --- a/test/gils/test2.sh +++ b/test/gils/test2.sh @@ -1,26 +1,35 @@ #!/bin/sh -# $Id: test2.sh,v 1.13 2005-01-03 12:08:04 adam Exp $ +# $Id: test2.sh,v 1.14 2006-04-27 10:52:26 marc Exp $ -pp=${srcdir:-"."} +srcdir=${srcdir:-"."} + +if [ "$srcdir" != "." ] + then + echo "Jumping over test" + exit 0 +fi LOG=test2.log rm -f $LOG echo "init..." >>$LOG -rm -f $pp/records/esdd000[12].grs # these should not be here, will be created later -../../index/zebraidx -l $LOG -c $pp/zebra2.cfg init || exit 1 + +# these should not be here, will be created later +$srcdir/cleanrecords.sh + +../../index/zebraidx -l $LOG -c $srcdir/zebra2.cfg init || exit 1 echo "update 1..." >>$LOG -../../index/zebraidx -l $LOG -c $pp/zebra2.cfg update $pp/records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra2.cfg update $srcdir/records || exit 1 echo "update 2..." >>$LOG -../../index/zebraidx -l $LOG -c $pp/zebra2.cfg update $pp/records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra2.cfg update $srcdir/records || exit 1 echo "killing old server (if any)..." >>$LOG test -f z.pid && kill -9 `cat z.pid` echo "starting server..." >>$LOG -../../index/zebrasrv -D -p z.pid -S -c $pp/zebra2.cfg -l $LOG unix:socket +../../index/zebrasrv -D -p z.pid -S -c $srcdir/zebra2.cfg -l $LOG unix:socket test -f z.pid || exit 1 echo "search 1..." >>$LOG @@ -28,35 +37,35 @@ echo "search 1..." >>$LOG grep "^Result count: 9$" log >/dev/null || exit 1 echo "update 3..." >>$LOG -../../index/zebraidx -l $LOG -c $pp/zebra2.cfg update $pp/records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra2.cfg update $srcdir/records || exit 1 echo "search 2..." >>$LOG ../api/testclient unix:socket "@attr 1=4 utah" > log || exit 1 grep "^Result count: 9$" log >/dev/null || exit 1 echo "making test records..." >>$LOG -cp $pp/records/esdd0006.grs $pp/records/esdd0001.grs +cp $srcdir/records/esdd0006.grs $srcdir/records/esdd0001.grs echo "indexing them..." >>$LOG -../../index/zebraidx -l $LOG -c $pp/zebra2.cfg update $pp/records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra2.cfg update $srcdir/records || exit 1 echo "search 3..." >>$LOG ../api/testclient unix:socket "@attr 1=4 utah" > log || exit 1 grep "^Result count: 10$" log >/dev/null || exit 1 -touch $pp/records/esdd0001.grs +touch $srcdir/records/esdd0001.grs echo "indexing again..." >>$LOG -../../index/zebraidx -l $LOG -c $pp/zebra2.cfg update $pp/records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra2.cfg update $srcdir/records || exit 1 echo "search 4..." >>$LOG ../api/testclient unix:socket "@attr 1=4 utah" > log || exit 1 grep "^Result count: 10$" log >/dev/null || exit 1 echo "making another test record..." >>$LOG -mv $pp/records/esdd0001.grs $pp/records/esdd0002.grs +mv $srcdir/records/esdd0001.grs $srcdir/records/esdd0002.grs echo "indexing it too..." >>$LOG -../../index/zebraidx -l $LOG -c $pp/zebra2.cfg update $pp/records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra2.cfg update $srcdir/records || exit 1 echo "search 5..." >>$LOG ../api/testclient unix:socket "@attr 1=4 utah" > log || exit 1 @@ -64,11 +73,11 @@ grep "^Result count: 10$" log >/dev/null || exit 1 sleep 1 echo "modifying a test record..." >>$LOG -sed 's/UTAH/XYZ/g' <$pp/records/esdd0002.grs >$pp/records/esdd0002x.grs -mv $pp/records/esdd0002x.grs $pp/records/esdd0002.grs +sed 's/UTAH/XYZ/g' <$srcdir/records/esdd0002.grs >$srcdir/records/esdd0002x.grs +mv $srcdir/records/esdd0002x.grs $srcdir/records/esdd0002.grs echo "indexing it..." >>$LOG -../../index/zebraidx -l $LOG -c $pp/zebra2.cfg update $pp/records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra2.cfg update $srcdir/records || exit 1 sleep 1 echo "search 6..." >>$LOG @@ -79,9 +88,9 @@ echo "search 7..." >>$LOG ../api/testclient unix:socket "@attr 1=4 xyz" > log || exit 1 grep "^Result count: 1$" log >/dev/null || exit 1 -echo "stopping server..." >>$LOG +echo "stosrcdiring server..." >>$LOG test -f z.pid || exit 1 kill `cat z.pid` || exit 1 rm -f log -rm -f $pp/records/esdd000[12].grs +$srcdir/cleanrecords.sh rm -f z.pid diff --git a/test/gils/test3.sh b/test/gils/test3.sh index 269aab7..fb5e07b 100755 --- a/test/gils/test3.sh +++ b/test/gils/test3.sh @@ -1,25 +1,34 @@ #!/bin/sh -# $Id: test3.sh,v 1.7 2005-01-03 12:08:04 adam Exp $ +# $Id: test3.sh,v 1.8 2006-04-27 10:52:26 marc Exp $ # Testing searches with lots of @and operators # in order to test the fast-forward operation of rsets -pp=${srcdir:-"."} +srcdir=${srcdir:-"."} + +if [ "$srcdir" != "." ] + then + echo "Jumping over test" + exit 0 +fi LOG=test3.log DBG="-v 1647" rm -f $LOG +# these should not be here, will be created later +$srcdir/cleanrecords.sh + echo "initializing..." >>$LOG mkdir -p reg -../../index/zebraidx -l $LOG -c $pp/zebra1.cfg init || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg init || exit 1 echo "updating..." >>$LOG -../../index/zebraidx -l $LOG -c $pp/zebra1.cfg update $pp/records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg update $srcdir/records || exit 1 echo "starting server..." >>$LOG -../../index/zebrasrv -D -p z.pid -S -c $pp/zebra1.cfg $DBG -l $LOG unix:socket +../../index/zebrasrv -D -p z.pid -S -c $srcdir/zebra1.cfg $DBG -l $LOG unix:socket echo "checking it runs..." >>$LOG test -f z.pid || exit 1 diff --git a/test/gils/timing1.sh b/test/gils/timing1.sh index 286bed3..dca9f01 100755 --- a/test/gils/timing1.sh +++ b/test/gils/timing1.sh @@ -1,26 +1,36 @@ #!/bin/sh -# $Id: timing1.sh,v 1.12 2005-01-03 12:08:04 adam Exp $ +# $Id: timing1.sh,v 1.13 2006-04-27 10:52:27 marc Exp $ # tests that updates are reflected immediately # in the registers. # Repeatedly modifies a record and counts hits. # Test 1: with good sleeps in every between - should pass always -pp=${srcdir:-"."} +srcdir=${srcdir:-"."} + +if [ "$srcdir" != "." ] + then + echo "Jumping over test" + exit 0 +fi LOG=timing1.log rm -f $LOG echo " init..." >>$LOG -rm -f $pp/records/esdd000[12].grs # these should not be here, will be created later -../../index/zebraidx -c $pp/zebra2.cfg -l $LOG init || exit 1 + +# these should not be here, will be created later +$srcdir/cleanrecords.sh + + +../../index/zebraidx -c $srcdir/zebra2.cfg -l $LOG init || exit 1 echo " starting server..." >>$LOG -../../index/zebrasrv -D -p z.pid -S -c $pp/zebra2.cfg -l $LOG unix:socket +../../index/zebrasrv -D -p z.pid -S -c $srcdir/zebra2.cfg -l $LOG unix:socket test -f z.pid || exit 1 sleep 2 echo " update 1..." >>$LOG -../../index/zebraidx -l $LOG -c $pp/zebra2.cfg update $pp/records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra2.cfg update $srcdir/records || exit 1 sleep 2 echo " search 1..." >>$LOG @@ -29,10 +39,10 @@ grep "^Result count: 9$" log >/dev/null || exit 1 sleep 2 echo "making a test record..." >>$LOG -cp $pp/records/esdd0006.grs $pp/records/esdd0002.grs +cp $srcdir/records/esdd0006.grs $srcdir/records/esdd0002.grs echo " indexing it..." >>$LOG -../../index/zebraidx -l $LOG -c $pp/zebra2.cfg update $pp/records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra2.cfg update $srcdir/records || exit 1 sleep 2 echo " search 2..." >>$LOG @@ -41,11 +51,11 @@ grep "^Result count: 10$" log >/dev/null || exit 1 sleep 2 echo " 1a: modifying a test record (xyz)..." >>$LOG -sed 's/UTAH/XYZ/g' <$pp/records/esdd0002.grs >$pp/records/esdd0002x.grs -mv $pp/records/esdd0002x.grs $pp/records/esdd0002.grs +sed 's/UTAH/XYZ/g' <$srcdir/records/esdd0002.grs >$srcdir/records/esdd0002x.grs +mv $srcdir/records/esdd0002x.grs $srcdir/records/esdd0002.grs echo " indexing it..." >>$LOG -../../index/zebraidx -l $LOG -c $pp/zebra2.cfg update $pp/records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra2.cfg update $srcdir/records || exit 1 sleep 2 echo " search 3..." >>$LOG @@ -55,11 +65,11 @@ grep "^Result count: 9$" log >/dev/null || exit 1 sleep 2 echo " 1b: modifying the test record back (utah)..." >>$LOG -sed 's/XYZ/UTAH/g' <$pp/records/esdd0002.grs >$pp/records/esdd0002x.grs -mv $pp/records/esdd0002x.grs $pp/records/esdd0002.grs +sed 's/XYZ/UTAH/g' <$srcdir/records/esdd0002.grs >$srcdir/records/esdd0002x.grs +mv $srcdir/records/esdd0002x.grs $srcdir/records/esdd0002.grs echo " indexing it..." >>$LOG -../../index/zebraidx -l $LOG -c $pp/zebra2.cfg update $pp/records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra2.cfg update $srcdir/records || exit 1 sleep 2 echo " search 4..." >>$LOG @@ -69,11 +79,11 @@ grep "^Result count: 10$" log >/dev/null || exit 1 sleep 2 echo " 2a: modifying the test record (xyz)..." >>$LOG -sed 's/UTAH/XYZ/g' <$pp/records/esdd0002.grs >$pp/records/esdd0002x.grs -mv $pp/records/esdd0002x.grs $pp/records/esdd0002.grs +sed 's/UTAH/XYZ/g' <$srcdir/records/esdd0002.grs >$srcdir/records/esdd0002x.grs +mv $srcdir/records/esdd0002x.grs $srcdir/records/esdd0002.grs echo " indexing it..." >>$LOG -../../index/zebraidx -l $LOG -c $pp/zebra2.cfg update $pp/records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra2.cfg update $srcdir/records || exit 1 sleep 2 echo " search 5..." >>$LOG @@ -83,12 +93,12 @@ grep "^Result count: 9$" log >/dev/null || exit 1 sleep 2 echo " 2b: modifying the test record back (utah)..." >>$LOG -sed 's/XYZ/UTAH/g' <$pp/records/esdd0002.grs >$pp/records/esdd0002x.grs -mv $pp/records/esdd0002x.grs $pp/records/esdd0002.grs +sed 's/XYZ/UTAH/g' <$srcdir/records/esdd0002.grs >$srcdir/records/esdd0002x.grs +mv $srcdir/records/esdd0002x.grs $srcdir/records/esdd0002.grs sleep 2 echo " indexing it..." >>$LOG -../../index/zebraidx -l $LOG -c $pp/zebra2.cfg update $pp/records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra2.cfg update $srcdir/records || exit 1 sleep 2 echo " search 6..." >>$LOG @@ -99,12 +109,12 @@ grep "^Result count: 10$" log >/dev/null || exit 1 sleep 2 echo " 3a: modifying the test record (xyz)..." >>$LOG -sed 's/UTAH/XYZ/g' <$pp/records/esdd0002.grs >$pp/records/esdd0002x.grs -mv $pp/records/esdd0002x.grs $pp/records/esdd0002.grs +sed 's/UTAH/XYZ/g' <$srcdir/records/esdd0002.grs >$srcdir/records/esdd0002x.grs +mv $srcdir/records/esdd0002x.grs $srcdir/records/esdd0002.grs sleep 2 echo " indexing it..." >>$LOG -../../index/zebraidx -l $LOG -c $pp/zebra2.cfg update $pp/records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra2.cfg update $srcdir/records || exit 1 sleep 2 echo " search 7..." >>$LOG @@ -114,11 +124,11 @@ grep "^Result count: 9$" log >/dev/null || exit 1 sleep 2 echo " 3b: modifying the test record back (utah)..." >>$LOG -sed 's/XYZ/UTAH/g' <$pp/records/esdd0002.grs >$pp/records/esdd0002x.grs -mv $pp/records/esdd0002x.grs $pp/records/esdd0002.grs +sed 's/XYZ/UTAH/g' <$srcdir/records/esdd0002.grs >$srcdir/records/esdd0002x.grs +mv $srcdir/records/esdd0002x.grs $srcdir/records/esdd0002.grs echo " indexing it..." >>$LOG -../../index/zebraidx -l $LOG -c $pp/zebra2.cfg update $pp/records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra2.cfg update $srcdir/records || exit 1 sleep 2 echo " search 8..." >>$LOG @@ -130,6 +140,6 @@ echo "stopping server..." >>$LOG test -f z.pid || exit 1 kill `cat z.pid` || exit 1 rm -f log -rm -f $pp/records/esdd000[12].grs +$srcdir/cleanrecords.sh rm -f z.pid diff --git a/test/gils/timing2.sh b/test/gils/timing2.sh index 5862b6e..5c807c2 100755 --- a/test/gils/timing2.sh +++ b/test/gils/timing2.sh @@ -1,8 +1,14 @@ #!/bin/sh -# $Id: timing2.sh,v 1.12 2005-01-03 12:08:04 adam Exp $ +# $Id: timing2.sh,v 1.13 2006-04-27 10:52:27 marc Exp $ # Demonstrated that updates depend on file timestamps -pp=${srcdir:-"."} +srcdir=${srcdir:-"."} + +if [ "$srcdir" != "." ] + then + echo "Jumping over test" + exit 0 +fi LOG=timing2.log @@ -10,41 +16,43 @@ rm -f $LOG echo " init..." >>$LOG rm -f log timeref[12] -rm -f $pp/records/esdd000[12].grs # these should not be here, will be created later -../../index/zebraidx -c $pp/zebra2.cfg -l $LOG init || exit 1 +# these should not be here, will be created later +$srcdir/cleanrecords.sh + +../../index/zebraidx -c $srcdir/zebra2.cfg -l $LOG init || exit 1 touch timeref1 # make an early timestamp echo " starting server..." >>$LOG -../../index/zebrasrv -D -p z.pid -S -c $pp/zebra2.cfg -l $LOG unix:socket +../../index/zebrasrv -D -p z.pid -S -c $srcdir/zebra2.cfg -l $LOG unix:socket test -f z.pid || exit 1 sleep 1 touch timeref2 # make a later timestamp echo " update 1..." >>$LOG -../../index/zebraidx -l $LOG -c $pp/zebra2.cfg update $pp/records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra2.cfg update $srcdir/records || exit 1 echo " search 1..." >>$LOG ../api/testclient unix:socket "@attr 1=4 utah" > log || exit 1 grep "^Result count: 9$" log >/dev/null || exit 1 echo "making a test record..." >>$LOG -cp $pp/records/esdd0006.grs $pp/records/esdd0002.grs -touch -r timeref1 $pp/records/esdd0002.grs +cp $srcdir/records/esdd0006.grs $srcdir/records/esdd0002.grs +touch -r timeref1 $srcdir/records/esdd0002.grs echo " indexing it..." >>$LOG -../../index/zebraidx -l $LOG -c $pp/zebra2.cfg update $pp/records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra2.cfg update $srcdir/records || exit 1 echo " search 2..." >>$LOG ../api/testclient unix:socket "@attr 1=4 utah" > log || exit 1 grep "^Result count: 10$" log >/dev/null || exit 1 echo " modifying a test record (xyz)..." >>$LOG -sed 's/UTAH/XYZ/g' <$pp/records/esdd0002.grs >$pp/records/esdd0002x.grs -mv $pp/records/esdd0002x.grs $pp/records/esdd0002.grs -touch -r timeref1 $pp/records/esdd0002.grs # reset timestamp to 'early' +sed 's/UTAH/XYZ/g' <$srcdir/records/esdd0002.grs >$srcdir/records/esdd0002x.grs +mv $srcdir/records/esdd0002x.grs $srcdir/records/esdd0002.grs +touch -r timeref1 $srcdir/records/esdd0002.grs # reset timestamp to 'early' echo " not indexing it..." >>$LOG -../../index/zebraidx -l $LOG -c $pp/zebra2.cfg update $pp/records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra2.cfg update $srcdir/records || exit 1 echo " search 3..." >>$LOG ../api/testclient unix:socket "@attr 1=4 utah" > log || exit 1 @@ -52,10 +60,10 @@ echo " checking..." >>$LOG grep "^Result count: 10$" log >/dev/null || exit 1 echo " touching its timestamp..." >>$LOG -touch -r timeref2 $pp/records/esdd0002.grs # set timestamp to 'late' +touch -r timeref2 $srcdir/records/esdd0002.grs # set timestamp to 'late' echo " indexing it..." >>$LOG -../../index/zebraidx -l $LOG -c $pp/zebra2.cfg update $pp/records || exit 1 +../../index/zebraidx -l $LOG -c $srcdir/zebra2.cfg update $srcdir/records || exit 1 echo " search 4..." >>$LOG ../api/testclient unix:socket "@attr 1=4 utah" > log || exit 1 @@ -66,6 +74,6 @@ echo "stopping server..." >>$LOG test -f z.pid || exit 1 kill `cat z.pid` || exit 1 rm -f log timeref[12] -rm -f $pp/records/esdd000[12].grs +$srcdir/cleanrecords.sh rm -f z.pid diff --git a/test/zsh/testall.sh b/test/zsh/testall.sh index 71729ff..57e3a7f 100755 --- a/test/zsh/testall.sh +++ b/test/zsh/testall.sh @@ -1,21 +1,27 @@ #!/bin/sh -# $Id: testall.sh,v 1.4 2004-06-15 09:43:34 adam Exp $ +# $Id: testall.sh,v 1.5 2006-04-27 10:52:27 marc Exp $ # run all zebrash tests -pp=${srcdir:-"."} +srcdir=${srcdir:-"."} + test -d reg || mkdir reg rm -f *.mf reg/*.mf *.out -for F in $pp/*.zsh +for F in $srcdir/*.zsh do echo $F - ../../index/zebrash -c $pp/zebra.cfg <$F >$F.out + if [ "." == $srcdir ] + then # running make check + ../../index/zebrash -c $srcdir/zebra.cfg <$F >$F.out + else # running make distcheck + ../../index/zebrash -c $srcdir/zebra.cfg <$F >/dev/null + fi RC=$? if [ "$RC" -gt "0" ] - then - echo "$F failed with exit code $RC" - FINAL=$RC + then + echo "$F failed with exit code $RC" + FINAL=$RC fi done if [ "$FINAL" ] -- 1.7.10.4