]> scripts.mit.edu Git - wizard.git/blob - tests/setup
Make phpBB installer more friendly for restricted envs.
[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 # we produce $TESTDIR and $TESTID for config and test script to use.
6
7 VERSION="$1"
8 if [ "$VERSION" == "" ]; then
9     if [ "$DEFAULT_HEAD" == "1" ]; then
10         VERSION="head"
11     else
12         echo "Must specify version"
13         exit 1
14     fi
15 fi
16
17 UVERSION=`echo "$VERSION" | sed s/[-.]/_/g`
18 TESTID="${TESTNAME}_$UVERSION"
19 echo "$TESTID"
20 TESTDIR="testdir_${TESTNAME}_$VERSION"
21 if [ "$WIZARD_ADMIN_NAME" == "" ]; then
22     export WIZARD_ADMIN_NAME="admin"
23 fi
24 if [ "$WIZARD_ADMIN_PASSWORD" == "" ]; then
25     export WIZARD_ADMIN_PASSWORD="wizard"
26 fi
27
28 if [ -e "config" ]; then
29     source ./config
30 fi
31
32 if [ -e "$TESTDIR" ]; then
33     echo "Removing previous $TESTDIR folder..."
34     wizard remove "$TESTDIR" || rm -Rf "$TESTDIR"
35 fi
36
37 if [ -e "prepare" ]; then
38     source ./prepare
39 fi
40