1#!/bin/sh - 2# 3# $Id: chk.bdb,v 12.1 2006/09/12 00:37:26 alexg Exp $ 4# 5# Run the collections/bind test suite. 6 7# NOTES: 8# This test requires one JAR not included with the Berkeley DB 9# distribution: JUnit (junit.jar) I've been using the 8/31/2002 version 10# of JUnit. You can download this JAR from http://jakarta.apache.org/ 11# 12# JUNIT_JAR=/Users/gburd/Unix/opt/junit/junit.jar 13 14[ "x$JUNIT_JAR" = "x" ] && { 15 echo 'FAIL: unset environment variable JUNIT_JAR for junit.jar.' 16 exit 1 17} 18 19[ -f $JUNIT_JAR ] || { 20 echo 'FAIL: JUNIT_JAR not a valid path to the junit.jar.' 21 exit 1 22} 23 24d=.. 25REQUIRED_JARS=$JUNIT_JAR 26DB_JAR=$d/db.jar 27DB_LIB_DIR=$d/.libs 28export DB_JAR 29export REQUIRED_JARS 30 31# Build the tests. 32 33make clean 34 35[ -f ./dbtest.jar ] || (make dbtest.jar) || { 36 echo 'FAIL: unable to find or build dbtest.jar' 37 exit 1 38} 39 40# Perform initialization needed before StoredClassCatalogTest is run in 41# the tests below. The testserial directory must be first in the classpath. 42 43c="com.sleepycat.collections.test.serial.StoredClassCatalogTestInit" 44echo "Running: $c" 45if java -Djava.library.path=$DB_LIB_DIR \ 46 -cp testserial:$REQUIRED_JARS:$DB_JAR:./dbtest.jar $c ; then 47 : 48else 49 echo "FAIL: test program failed" 50 exit 1 51fi 52 53# Run the tests. 54 55for f in `find classes -name "*Test.class"`; do 56 c=`echo "$f" | sed -e 's/classes\///' -e 's/\.class//' -e 's/\//./g'` 57 echo "Running: $c" 58 if java -Djava.library.path=$DB_LIB_DIR \ 59 -cp $REQUIRED_JARS:$DB_JAR:./dbtest.jar $c ; then 60 : 61 else 62 echo "FAIL: test program failed" 63 exit 1 64 fi 65done 66 67exit 0 68