]> scripts.mit.edu Git - wizard.git/blob - tests/setup
Set admin e-mail address properly on MediaWiki >= 1.18.0
[wizard.git] / tests / setup
1 # this file is meant to be source'd by any test script
2 # we expect the source script to have specified:
3 #   VERSION = version number to apply the test to
4 #   TESTNAME = name of the test
5 #   APP = name of the application being tested
6 # we produce $TESTDIR, $TESTID, $UVERSION and $APPVERSION
7 # for config and test script to use.
8
9 export PATH="`pwd`/../bin:$PATH"
10
11 VERSION="$1"
12 if [ "$VERSION" == "" ]; then
13     if [ "$DEFAULT_HEAD" == "1" ]; then
14         VERSION="head"
15     else
16         echo "Must specify version"
17         exit 1
18     fi
19 fi
20
21 # APPVERSION is directly interpolated into bash, so it can represent
22 # 0 arguments.
23 if [ "$VERSION" == "head" ]; then
24     APPVERSION="$APP"
25 else
26     APPVERSION="$APP-$VERSION-scripts" # XXX incorrect if a -scripts2 version exists
27 fi
28
29 UVERSION=`echo "$VERSION" | sed s/[-.]/_/g`
30 TESTID="${TESTNAME}_$UVERSION"
31 echo "$TESTID"
32 TESTDIR="testdir_${TESTNAME}_$VERSION"
33 if [ "$WIZARD_ADMIN_NAME" == "" ]; then
34     export WIZARD_ADMIN_NAME="admin"
35 fi
36 if [ "$WIZARD_ADMIN_PASSWORD" == "" ]; then
37     export WIZARD_ADMIN_PASSWORD="wizard"
38 fi
39
40 if [ -e "config" ]; then
41     source ./config
42 fi
43
44 if [ -e "$TESTDIR" ]; then
45     echo "Removing previous $TESTDIR folder..."
46     wizard remove "$TESTDIR" || rm -Rf "$TESTDIR"
47 fi
48