]> scripts.mit.edu Git - wizard.git/blob - tests/setup
Move wizard.scripts module to plugins, added hooks accordingly.
[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 export PATH="`pwd`/../bin:$PATH"
8
9 VERSION="$1"
10 if [ "$VERSION" == "" ]; then
11     if [ "$DEFAULT_HEAD" == "1" ]; then
12         VERSION="head"
13     else
14         echo "Must specify version"
15         exit 1
16     fi
17 fi
18
19 UVERSION=`echo "$VERSION" | sed s/[-.]/_/g`
20 TESTID="${TESTNAME}_$UVERSION"
21 echo "$TESTID"
22 TESTDIR="testdir_${TESTNAME}_$VERSION"
23 if [ "$WIZARD_ADMIN_NAME" == "" ]; then
24     export WIZARD_ADMIN_NAME="admin"
25 fi
26 if [ "$WIZARD_ADMIN_PASSWORD" == "" ]; then
27     export WIZARD_ADMIN_PASSWORD="wizard"
28 fi
29
30 if [ -e "config" ]; then
31     source ./config
32 fi
33
34 if [ -e "$TESTDIR" ]; then
35     echo "Removing previous $TESTDIR folder..."
36     wizard remove "$TESTDIR" || rm -Rf "$TESTDIR"
37 fi
38