~ubuntu-branches/ubuntu/natty/evolution-data-server/natty

« back to all changes in this revision

Viewing changes to libdb/test/scr015/chk.cxxtests

  • 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 C++ run.
6
 
 
7
 
TEST_CXX_SRCDIR=../test/scr015  # must be a relative directory
8
 
 
9
 
# All paths must be relative to a subdirectory of the build directory
10
 
LIBS="-L.. -ldb -ldb_cxx"
11
 
CXXFLAGS="-I.. -I../../dbinc"
12
 
 
13
 
# Test must be run from a local build directory, not from a test
14
 
# directory.
15
 
cd ..
16
 
[ -f db_config.h ] || {
17
 
        echo 'FAIL: chk.cxxtests must be run from a local build directory.'
18
 
        exit 1
19
 
}
20
 
[ -d ../docs_src ] || {
21
 
        echo 'FAIL: chk.cxxtests must be run from a local build directory.'
22
 
        exit 1
23
 
}
24
 
[ -f libdb.a ] || make libdb.a || {
25
 
        echo 'FAIL: unable to build libdb.a'
26
 
        exit 1
27
 
}
28
 
[ -f libdb_cxx.a ] || make libdb_cxx.a || {
29
 
        echo 'FAIL: unable to build libdb_cxx.a'
30
 
        exit 1
31
 
}
32
 
CXX=`sed -e '/^CXX=/!d' -e 's/^CXX=//' -e 's/.*mode=compile *//' Makefile`
33
 
echo "  ====== cxx tests using $CXX"
34
 
testnames=`cd $TEST_CXX_SRCDIR; ls *.cpp | sed -e 's/\.cpp$//'`
35
 
 
36
 
for testname in $testnames; do
37
 
        if grep -x $testname $TEST_CXX_SRCDIR/ignore > /dev/null; then
38
 
                echo "    **** cxx test $testname ignored"
39
 
                continue
40
 
        fi
41
 
 
42
 
        echo "    ==== cxx test $testname"
43
 
        rm -rf TESTCXX; mkdir TESTCXX
44
 
        cd ./TESTCXX
45
 
        testprefix=../$TEST_CXX_SRCDIR/$testname
46
 
 
47
 
        ${CXX} ${CXXFLAGS} -o $testname $testprefix.cpp ${LIBS} > ../$testname.compileout 2>&1 || {
48
 
                echo "FAIL: compilation of $testname failed, see ../$testname.compileout"
49
 
                exit 1
50
 
        }
51
 
        rm -f ../$testname.compileout
52
 
        infile=$testprefix.testin
53
 
        [ -f $infile ] || infile=/dev/null
54
 
        goodoutfile=$testprefix.testout
55
 
        [ -f $goodoutfile ] || goodoutfile=/dev/null
56
 
        gooderrfile=$testprefix.testerr
57
 
        [ -f $gooderrfile ] || gooderrfile=/dev/null
58
 
        ./$testname <$infile >../$testname.out 2>../$testname.err
59
 
        cmp ../$testname.out $goodoutfile > /dev/null || {
60
 
                echo "FAIL: $testname output differs: see ../$testname.out, $goodoutfile"
61
 
                exit 1
62
 
        }
63
 
        cmp ../$testname.err $gooderrfile > /dev/null || {
64
 
                echo "FAIL: $testname error differs: see ../$testname.err, $gooderrfile"
65
 
                exit 1
66
 
        }
67
 
        cd ..
68
 
        rm -f $testname.err $testname.out
69
 
done
70
 
rm -rf TESTCXX
71
 
exit 0