#
# Part of the ht://Dig package   <http://www.htdig.org/>
# Copyright (c) 1999, 2000, 2001 The ht://Dig Group
# For copyright details, see the file COPYING in your distribution
# or the GNU General Public License version 2 or later
# <http://www.gnu.org/copyleft/gpl.html>
#
# $Id: t_cache,v 1.5 2001/06/29 14:14:08 loic Exp $
#

. ./test_functions

if [ "$LONG" ]
then
	export MIFLUZ_CONFIG ; MIFLUZ_CONFIG=${srcdir}/mifluz-cache.conf
	rm -f test
	#
	# Assume the first dbbench takes more than 1 minute
	# and production of a temporary file takes less than 20 seconds.
	#
	./dbbench -Wz -w ${srcdir}/cache.txt -B test -l 20000 &
	sleep 20
	./dbbench -Wz -w ${srcdir}/cache1.txt -B test -l 10
	wait
	../htdb/mifluzdict test | cut -d' ' -f1,3 > cache-dict.out
	cmp ${srcdir}/cache-dict.txt cache-dict.out ||
		diff ${srcdir}/cache-dict.txt cache-dict.out
else
	echo "SKIP: t_cache (run with make LONG=yes TESTS=t_cache check)"
	exit 77
fi