4
# Run just one Java regression test, the single argument
5
# is the classname within this package.
10
echo "Java regression error: $@" >&2
15
# compares the result against the good version,
16
# reports differences, and removes the result file
17
# if there are no differences.
23
if [ ! -e "$good" ]; then
24
echo "Note: $good does not exist"
27
tmpout=/tmp/blddb$$.tmp
28
diff "$good" "$latest" > $tmpout
29
if [ -s $tmpout ]; then
30
nbad=`grep '^[0-9]' $tmpout | wc -l`
31
error "$good and $latest differ in $nbad places."
43
# classdir is relative to TESTDIR subdirectory
46
# CLASSPATH is used by javac and java.
47
# We use CLASSPATH rather than the -classpath command line option
48
# because the latter behaves differently from JDK1.1 and JDK1.2
49
export CLASSPATH="$classdir:$CLASSPATH"
51
# determine the prefix of the install tree
57
prefix="`echo $1 | sed -e 's/--prefix=//'`"; shift
58
export LD_LIBRARY_PATH="$prefix/lib:$LD_LIBRARY_PATH"
59
export CLASSPATH="$prefix/lib/db.jar:$CLASSPATH"
71
echo 'Usage: testone [ --prefix=<dir> | --stdin ] TestName'
76
# class must be public
77
if ! grep "public.*class.*$name" $name.java > /dev/null; then
78
error "public class $name is not declared in file $name.java"
83
rm -rf TESTDIR; mkdir TESTDIR
86
${JAVAC} -d $classdir ../$name.java ../TestUtil.java > ../$name.compileout 2>&1
87
if [ $? != 0 -o -s ../$name.compileout ]; then
88
error "compilation of $name failed, see $name.compileout"
91
rm -f ../$name.compileout
93
# find input and error file
94
infile=../$name.testin
95
if [ ! -f $infile ]; then
99
# run and diff results
101
if [ "$stdinflag" = y ]
103
${JAVA} com.sleepycat.test.$name $TEST_ARGS >../$name.out 2>../$name.err
105
${JAVA} com.sleepycat.test.$name $TEST_ARGS <$infile >../$name.out 2>../$name.err
109
testerr=$name.testerr
110
if [ ! -f $testerr ]; then
114
testout=$name.testout
115
if [ ! -f $testout ]; then
119
compare_result $testout $name.out
120
compare_result $testerr $name.err