head	1.4;
access;
symbols
	rpm-4_4_8-release:1.3.2.1
	rpm-4_4_7-release:1.3.2.1
	db-4_5_20:1.4
	rpm-4_4_6-release:1.3.2.1
	rpm-4_4_5-release:1.3.2.1
	db-4_4_20:1.4
	rpm-4_4_4-release:1.3.2.1
	db-4_4_16:1.4
	rpm-4_4_3-release:1.3.2.1
	db-4_4_11:1.4
	db-4_3_29:1.3
	jbj_before_tklcpatches:1.3
	rpm-4_4_2-release:1.3
	pjones-sparse-experiment:1.4.0.2
	db-4_4_4:1.4
	rpm-4_4_1-release:1.3
	db-4_3_27:1.3
	rpm-4_4-release:1.3
	rpm-4_4:1.3.0.2
	db-4_3_21:1.3
	db-4_3_14:1.3
	db-4_2_52:1.2
	rpm-4_3_1-start:1.2
	rpm-4_3:1.2.0.2
	rpm-4_2_1-release:1.1
	rpm-4_1_1-release:1.1
	rpm-4_2-release:1.1
	rpm-4_2:1.1.0.6
	postmerge-db-4_1_24-release:1.1
	premerge-db-4_1_24-release:1.1
	db-4_1_24-release:1.1.1.2
	pre-db-4_1_24-release:1.1.1.2
	rpm-4_1-release:1.1
	postmerge-db-4_1_17:1.1
	premerge-db-4_1_17:1.1
	db-4_1_17:1.1.1.2
	pre-db-4_1_17:1.1.1.1
	rpm-4_1:1.1.0.4
	rpm-4_0_4-release:1.1.2.2
	jbj-before-beecrypt:1.1.2.2
	rpm-4_0:1.1.0.2
	postmerge-db-4_0_14:1.1.1.1
	premerge-db-4_0_14:1.1.1.1
	db-4_0_14:1.1.1.1
	pre-db-4_0_14:1.1.1.1
	postmerge-db-4_0_7:1.1.1.1
	premerge-db-4_0_7:1.1.1.1
	db-4_0_7:1.1.1.1
	db-3_2_9-vendor:1.1.1;
locks; strict;
comment	@# @;
expand	@o@;


1.4
date	2005.02.21.15.54.07;	author jbj;	state Exp;
branches;
next	1.3;

1.3
date	2004.10.16.01.32.06;	author jbj;	state Exp;
branches
	1.3.2.1;
next	1.2;

1.2
date	2003.12.15.21.44.44;	author jbj;	state Exp;
branches;
next	1.1;

1.1
date	2001.10.15.03.47.29;	author jbj;	state Exp;
branches
	1.1.1.1
	1.1.2.1;
next	;

1.1.1.1
date	2001.10.15.03.47.29;	author jbj;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2002.08.14.16.32.03;	author jbj;	state Exp;
branches;
next	;

1.1.2.1
date	2002.01.08.04.07.49;	author jbj;	state Exp;
branches;
next	1.1.2.2;

1.1.2.2
date	2002.01.08.13.50.58;	author jbj;	state Exp;
branches;
next	;

1.3.2.1
date	2005.10.28.18.45.06;	author jbj;	state Exp;
branches;
next	;


desc
@@


1.4
log
@Upgrade to db-4.4.4.
@
text
@#!/bin/sh -
#	$Id: testone,v 12.0 2004/11/17 03:44:48 bostic Exp $
#
# Run just one C++ regression test, the single argument
# is the basename of the test, e.g. TestRpcServer

error()
{
	echo '' >&2
	echo "C++ regression error: $@@" >&2
	echo '' >&2
	ecode=1
}

# compares the result against the good version,
# reports differences, and removes the result file
# if there are no differences.
#
compare_result()
{
	good="$1"
	latest="$2"
	if [ ! -e "$good" ]; then
		echo "Note: $good does not exist"
		return
	fi
	tmpout=/tmp/blddb$$.tmp
	diff "$good" "$latest" > $tmpout
	if [ -s $tmpout ]; then
		nbad=`grep '^[0-9]' $tmpout | wc -l`
		error "$good and $latest differ in $nbad places."
	else
		rm $latest
	fi
	rm -f $tmpout
}

ecode=0
stdinflag=n
gdbflag=n
CXX=${CXX:-c++}
LIBS=${LIBS:-}

# remove any -c option in the CXXFLAGS
CXXFLAGS="`echo " ${CXXFLAGS} " | sed -e 's/ -c //g'`"

# determine the prefix of the install tree
prefix=""
while :
do
	case "$1" in
	--prefix=* )
		prefix="`echo $1 | sed -e 's/--prefix=//'`"; shift
		LIBS="-L$prefix/lib -ldb_cxx $LIBS"
		CXXFLAGS="-I$prefix/include $CXXFLAGS"
	        export LD_LIBRARY_PATH="$prefix/lib:$LD_LIBRARY_PATH"
		;;
	--stdin )
		stdinflag=y; shift
		;;
	--gdb )
		CXXFLAGS="-g $CXXFLAGS"
		gdbflag=y; shift
		;;
        * )
		break
                ;;
	esac
done

if [ "$#" = 0 ]; then
	echo 'Usage: testone [ --prefix=<dir> | --stdin ] TestName'
        exit 1
fi
name="$1"

# compile
rm -rf TESTDIR; mkdir TESTDIR
cd ./TESTDIR

${CXX} ${CXXFLAGS} -o $name ../$name.cpp ${LIBS} > ../$name.compileout 2>&1
if [ $? != 0 -o -s ../$name.compileout ]; then
	error "compilation of $name failed, see $name.compileout"
	exit 1
fi
rm -f ../$name.compileout

# find input and error file
infile=../$name.testin
if [ ! -f $infile ]; then
	infile=/dev/null
fi

# run and diff results
rm -rf TESTDIR
if [ "$gdbflag" = y ]; then
	if [ -s $infile ]; then
		echo "Input file is $infile"
	fi
	gdb ./$name
        exit 0
elif [ "$stdinflag" = y ]; then
	./$name           >../$name.out 2>../$name.err
else
	./$name  <$infile >../$name.out 2>../$name.err
fi
cd ..

testerr=$name.testerr
if [ ! -f $testerr ]; then
	testerr=/dev/null
fi

testout=$name.testout
if [ ! -f $testout ]; then
	testout=/dev/null
fi

compare_result $testout $name.out
compare_result $testerr $name.err
rm -rf TESTDIR
exit $ecode
@


1.3
log
@... and in with the New ...
@
text
@d2 1
a2 1
#	$Id: testone,v 1.5 2002/07/05 22:17:59 dda Exp $
@


1.3.2.1
log
@Update to db-4.4.11.
@
text
@d2 1
a2 1
#	$Id: testone,v 12.0 2004/11/17 03:44:48 bostic Exp $
@


1.2
log
@- upgrade to db-4.2.52.
@
text
@@


1.1
log
@Initial revision
@
text
@d2 1
a2 1
#	Id: testone,v 1.3 2001/09/11 19:14:16 dda Exp 
d80 1
@


1.1.2.1
log
@Update to db-4.0.14.
@
text
@d2 1
a2 1
#	$Id: testone,v 1.3 2001/09/11 19:14:16 dda Exp $
@


1.1.2.2
log
@Orphans.
@
text
@d2 1
a2 1
#	Id: testone,v 1.3 2001/09/11 19:14:16 dda Exp 
@


1.1.1.1
log
@track: auto import
@
text
@@


1.1.1.2
log
@track: auto import
@
text
@d2 1
a2 1
#	Id: testone,v 1.5 2002/07/05 22:17:59 dda Exp 
a79 1

@

