~svn/ubuntu/raring/subversion/ppa

« back to all changes in this revision

Viewing changes to tools/test-scripts/svntest/svntest-config.sh

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:26:14 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205012614-qom4xfypgtsqc2xq
Tags: 1.2.3dfsg1-3ubuntu1
Merge with the final Debian release of 1.2.3dfsg1-3, bringing in
fixes to the clean target, better documentation of the libdb4.3
upgrade and build fixes to work with swig1.3_1.3.27.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
#
 
4
# Root of the test tree
 
5
#
 
6
TEST_ROOT="/home/brane/svn"
 
7
 
 
8
# Installation path, everything under that is considered
 
9
# to be temporary
 
10
INST_DIR="$TEST_ROOT/inst"
 
11
 
 
12
#
 
13
# Repository paths and projects name
 
14
#
 
15
# installation paths are expected to be:
 
16
# '$INST_DIR/<proj_name>, so take care of your
 
17
# $CONFIG_PREFIX.<proj_name> files.
 
18
# Everything in those directories will be wiped out
 
19
# by installation procedure. See svntest-rebuild-generic.sh
 
20
 
 
21
SVN_NAME=${SVN_NAME:="svn"}
 
22
SVN_REPO=${SVN_REPO:="$TEST_ROOT/$SVN_NAME"}
 
23
 
 
24
APR_NAME=${APR_NAME:="apr-0.9"}
 
25
APR_REPO=${ARP_REPO:="$TEST_ROOT/$APR_NAME"}
 
26
 
 
27
APU_NAME=${APU_NAME:="apr-util-0.9"}
 
28
APU_REPO=${APU_REPO:="$TEST_ROOT/$APU_NAME"}
 
29
 
 
30
HTTPD_NAME=${HTTPD_NAME:="httpd-2.0"}
 
31
HTTPD_REPO=${HTTPD_REPO:="$TEST_ROOT/$HTTPD_NAME"}
 
32
 
 
33
 
 
34
MAKE_OPTS=
 
35
 
 
36
# RAMDISK=<yes|no>
 
37
RAMDISK=no
 
38
 
 
39
#
 
40
# Whether to test the BDB backend, TEST_FSFS=<yes|no>
 
41
#
 
42
TEST_BDB=${TEST_BDB:="yes"}
 
43
 
 
44
#
 
45
# Whether to test the FSFS backend, TEST_FSFS=<yes|no>
 
46
#
 
47
TEST_FSFS=${TEST_FSFS:="yes"}
 
48
 
 
49
#
 
50
# Whether to test various bindings
 
51
#
 
52
TEST_BINDINGS_SWIG_PERL=${TEST_BINDINGS_SWIG_PERL:="no"}
 
53
TEST_BINDINGS_JAVAHL=${TEST_BINDINGS_JAVAHL:="no"}
 
54
TEST_BINDINGS_SWIG_PYTHON=${TEST_BINDINGS_SWIG_PYTHON:="no"}
 
55
 
 
56
# This should correspond with your httpd Listen directive
 
57
RA_DAV_CHECK_ARGS="BASE_URL=http://localhost:42024"
 
58
 
 
59
#
 
60
# Log file name prefix
 
61
#
 
62
LOG_FILE_DIR="$TEST_ROOT/logs/$SVN_NAME"
 
63
LOG_FILE_PREFIX="$LOG_FILE_DIR/LOG_svntest"
 
64
 
 
65
#
 
66
# Configure script prefix and object directory names
 
67
#
 
68
CONFIG_PREFIX="config"
 
69
OBJ_STATIC="obj-st"
 
70
OBJ_SHARED="obj-sh"
 
71
 
 
72
#
 
73
# E-mail addresses for reporting
 
74
#
 
75
FROM="brane@xbc.nu"
 
76
TO="svn-breakage@subversion.tigris.org"
 
77
ERROR_TO="brane@hermes.si"
 
78
REPLY_TO="dev@subversion.tigris.org"
 
79
 
 
80
#
 
81
# Path to utilities
 
82
#
 
83
BIN="/bin"
 
84
USRBIN="/usr/bin"
 
85
LOCALBIN="/usr/local/bin"
 
86
OPTBIN="/opt/bin"
 
87
PERLBIN="/usr/bin"
 
88
 
 
89
# Statically linked svn binary (used for repository updates)
 
90
SVN="$TEST_ROOT/static/bin/svn"
 
91
 
 
92
# CVS binary (used for updating APR & friends)
 
93
CVS="$USRBIN/cvs"
 
94
 
 
95
# Path to config.guess (used for generating the mail subject line)
 
96
GUESS="/usr/share/libtool/config.guess"
 
97
 
 
98
# Path to sendmail
 
99
SENDMAIL="/usr/sbin/sendmail"
 
100
 
 
101
# A program used to base64 encode standard input.  Two choices are
 
102
# 1) The encode-base64 script that comes with the Perl MIME::Base64
 
103
#    module on CPAN at
 
104
#    ftp://ftp.funet.fi/pub/CPAN/modules/by-module/MIME/
 
105
#
 
106
#    To install, get the latest MIME-Base64-X.YY.tar.gz and run
 
107
#    perl Makefile.PL
 
108
#    make
 
109
#    make test
 
110
#    make install UNINST=1
 
111
#
 
112
#    Uncomment here if you use this base64 encoder:
 
113
#
 
114
#    BASE64="$PERLBIN/encode-base64"
 
115
#    BASE64_E="$BASE64"
 
116
#
 
117
# 2) A pre-compiled Windows base64.exe binary for Windows users.  C
 
118
#    source code for other OSes.  Available at
 
119
#    http://www.fourmilab.ch/webtools/base64/
 
120
#
 
121
#    No instructions needed.  If you can compile and test Subversion,
 
122
#    then you can compile this :)
 
123
#
 
124
#    Uncomment here if you use this base64 encoder:
 
125
#
 
126
#    BASE64="$USRBIN/base64"
 
127
#    BASE64_E="$BASE64 -e - -"
 
128
 
 
129
# Other stuff
 
130
CAT="$BIN/cat"
 
131
CP="$BIN/cp"
 
132
CP_F="$CP -f"
 
133
CUT="$USRBIN/cut"
 
134
DATE="$BIN/date"
 
135
GREP="$BIN/grep"
 
136
GZIP="$BIN/gzip"
 
137
GZIP_C="$GZIP -9c"
 
138
ID="$USRBIN/id"
 
139
ID_UN="$ID -un"
 
140
KILL="$BIN/kill"
 
141
MAKE="$USRBIN/make"
 
142
MKDIR="$BIN/mkdir"
 
143
MKDIR_P="$MKDIR -p"
 
144
MOUNT="$BIN/mount"
 
145
NICE="$USRBIN/nice"
 
146
PS="$BIN/ps"
 
147
PS_U="$PS -u"
 
148
RM="$BIN/rm"
 
149
RM_F="$RM -f"
 
150
RM_RF="$RM -rf"
 
151
SED="$BIN/sed"
 
152
TAIL="$USRBIN/tail"
 
153
TAIL_100="$TAIL -n 100"
 
154
TOUCH="$USRBIN/touch"
 
155
UMOUNT="$BIN/umount"
 
156
 
 
157
#
 
158
# Branch prefix for the e-mail subject
 
159
#
 
160
REVPREFIX=`$SVN info $SVN_REPO | $SED -ne 's@^URL:.*/repos/svn/\(branches/\)*\(.*\)$@\2 r@p'`
 
161
 
 
162
#
 
163
# Revision number for the e-mail subject
 
164
#
 
165
REVISION=`$SVN info $SVN_REPO | $SED -ne 's@^Revision: \(.*\)$@\1@p'`
 
166
 
 
167
#
 
168
# Helper functions
 
169
#
 
170
 
 
171
# Start a test
 
172
START() {
 
173
    TST="$1"
 
174
    echo ""
 
175
    echo "$2"
 
176
}
 
177
 
 
178
# Test failed
 
179
FAIL() {
 
180
    echo "FAIL: $TST" >> $LOG_FILE
 
181
    test -n "$1" && eval "$1" "$@"  # Run cleanup code
 
182
    umount_ramdisk "$TEST_ROOT/$OBJ_STATIC/subversion/tests"
 
183
    umount_ramdisk "$TEST_ROOT/$OBJ_SHARED/subversion/tests"
 
184
    exit 1
 
185
}
 
186
 
 
187
# Test passed
 
188
PASS() {
 
189
    echo "PASS: $TST" >> $LOG_FILE
 
190
}
 
191
 
 
192
# Copy a partial log to the main log file
 
193
FAIL_LOG() {
 
194
    echo >> $LOG_FILE
 
195
    echo "Last 100 lines of the log file follow:" >> $LOG_FILE
 
196
    $TAIL_100 "$1" >> $LOG_FILE 2>&1
 
197
    if [ "x$REV" = "x" ]
 
198
    then
 
199
        SAVED_LOG="$1.failed"
 
200
    else
 
201
        SAVED_LOG="$1.$REV.failed"
 
202
    fi
 
203
    $CP "$1" "$SAVED_LOG" >> $LOG_FILE 2>&1
 
204
    echo "Complete log saved in $SAVED_LOG" >> $LOG_FILE
 
205
}
 
206
 
 
207
# Mount ramdisk conditionally
 
208
# check that
 
209
# i)  RAMDISK is defined
 
210
# ii) Ramdisk isn't already mounted
 
211
mount_ramdisk() {
 
212
    local mount_dir="$1"
 
213
    if test "xyes" = "x$RAMDISK";
 
214
    then
 
215
        test -z "$mount_dir" && return 1
 
216
 
 
217
        test -f "$mount_dir/.ramdisk" && {
 
218
            echo "Warning: ramdisk exists"
 
219
            return 0
 
220
        }
 
221
 
 
222
        $MOUNT "$mount_dir" || return 1
 
223
        $TOUCH "$mount_dir/.ramdisk" || return 1
 
224
    fi
 
225
    return 0
 
226
}
 
227
 
 
228
umount_ramdisk() {
 
229
    local mount_dir="$1"
 
230
    if test "xyes" = "x$RAMDISK";
 
231
    then
 
232
        test -z "$mount_dir" && return 1
 
233
 
 
234
        test -f "$mount_dir/.ramdisk" && {
 
235
            $UMOUNT "$mount_dir" >> /dev/null 2>&1 || return 1
 
236
        }
 
237
    fi
 
238
    return 0
 
239
}
 
240
 
 
241
#
 
242
# Re-initialize ramdisk if it is currently unmounted.
 
243
#
 
244
reinitialize_ramdisk () {
 
245
    test -x "$TEST_ROOT/$OBJ/subversion/tests/clients" || {
 
246
        START "re-initializing ramdisk" "Re-initializing ramdisk"
 
247
        mount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests" \
 
248
            >> "$LOG_FILE" 2>&1 || FAIL
 
249
        cd "$TEST_ROOT/$OBJ"
 
250
        $MAKE  mkdir-init > "$LOG_FILE.ramdisk" 2>&1
 
251
        test $? = 0 || {
 
252
            FAIL_LOG "$LOG_FILE.ramdisk"
 
253
            FAIL
 
254
        }
 
255
        $MAKE $MAKE_OPTS > "$LOG_FILE.ramdisk" 2>&1
 
256
        test $? = 0 || {
 
257
            FAIL_LOG "$LOG_FILE.ramdisk"
 
258
            FAIL
 
259
        }
 
260
        PASS
 
261
    }
 
262
}
 
263