~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to libdb/test/scr016/chk.javatests

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh -
2
 
#
3
 
# $Id$
4
 
#
5
 
# Check to make sure that regression tests for Java run.
6
 
 
7
 
TEST_JAVA_SRCDIR=../test/scr016  # must be a relative directory
8
 
JAVA=${JAVA:-java}
9
 
JAVAC=${JAVAC:-javac}
10
 
 
11
 
# CLASSPATH is used by javac and java.
12
 
# We use CLASSPATH rather than the -classpath command line option
13
 
# because the latter behaves differently from JDK1.1 and JDK1.2
14
 
export CLASSPATH="./classes:../db.jar"
15
 
export LD_LIBRARY_PATH="../.libs"
16
 
 
17
 
 
18
 
# All paths must be relative to a subdirectory of the build directory
19
 
LIBS="-L.. -ldb -ldb_cxx"
20
 
CXXFLAGS="-I.. -I../../dbinc"
21
 
 
22
 
# Test must be run from a local build directory, not from a test
23
 
# directory.
24
 
cd ..
25
 
[ -f db_config.h ] || {
26
 
        echo 'FAIL: chk.javatests must be run from a local build directory.'
27
 
        exit 1
28
 
}
29
 
[ -d ../docs_src ] || {
30
 
        echo 'FAIL: chk.javatests must be run from a local build directory.'
31
 
        exit 1
32
 
}
33
 
version=`sed -e 's/.* \([0-9]*\.[0-9]*\)\..*/\1/' -e q ../README `
34
 
[ -f libdb_java-$version.la ] || make libdb_java-$version.la || {
35
 
        echo "FAIL: unable to build libdb_java-$version.la"
36
 
        exit 1
37
 
}
38
 
[ -f db.jar ] || make db.jar || {
39
 
        echo 'FAIL: unable to build db.jar'
40
 
        exit 1
41
 
}
42
 
testnames=`cd $TEST_JAVA_SRCDIR; ls *.java | sed -e 's/\.java$//'`
43
 
 
44
 
for testname in $testnames; do
45
 
        if grep -x $testname $TEST_JAVA_SRCDIR/ignore > /dev/null; then
46
 
                echo "    **** java test $testname ignored"
47
 
                continue
48
 
        fi
49
 
 
50
 
        echo "    ==== java test $testname"
51
 
        rm -rf TESTJAVA; mkdir -p TESTJAVA/classes
52
 
        cd ./TESTJAVA
53
 
        testprefix=../$TEST_JAVA_SRCDIR/$testname
54
 
        ${JAVAC} -d ./classes $testprefix.java ../$TEST_JAVA_SRCDIR/TestUtil.java > ../$testname.compileout 2>&1 || {
55
 
pwd
56
 
                echo "FAIL: compilation of $testname failed, see ../$testname.compileout"
57
 
                exit 1
58
 
        }
59
 
        rm -f ../$testname.compileout
60
 
        infile=$testprefix.testin
61
 
        [ -f $infile ] || infile=/dev/null
62
 
        goodoutfile=$testprefix.testout
63
 
        [ -f $goodoutfile ] || goodoutfile=/dev/null
64
 
        gooderrfile=$testprefix.testerr
65
 
        [ -f $gooderrfile ] || gooderrfile=/dev/null
66
 
        ${JAVA} com.sleepycat.test.$testname <$infile >../$testname.out 2>../$testname.err
67
 
        cmp ../$testname.out $goodoutfile > /dev/null || {
68
 
                echo "FAIL: $testname output differs: see ../$testname.out, $goodoutfile"
69
 
                exit 1
70
 
        }
71
 
        cmp ../$testname.err $gooderrfile > /dev/null || {
72
 
                echo "FAIL: $testname error differs: see ../$testname.err, $gooderrfile"
73
 
                exit 1
74
 
        }
75
 
        cd ..
76
 
        rm -f $testname.err $testname.out
77
 
done
78
 
rm -rf TESTJAVA
79
 
exit 0