|
1 #!/bin/bash |
|
2 # This Source Code Form is subject to the terms of the Mozilla Public |
|
3 # License, v. 2.0. If a copy of the MPL was not distributed with this file, |
|
4 # You can obtain one at http://mozilla.org/MPL/2.0/. |
|
5 |
|
6 PYTHON=$1 |
|
7 |
|
8 if [ -z "${PYTHON}" ] |
|
9 then |
|
10 echo "No python found" |
|
11 exit 1 |
|
12 fi |
|
13 |
|
14 if [ -z "${MARIONETTE_HOME}" ] |
|
15 then |
|
16 echo "No MARIONETTE_HOME found" |
|
17 exit 1 |
|
18 fi |
|
19 |
|
20 if [ -z "${XPCSHELLTEST_HOME}" ] |
|
21 then |
|
22 echo "No XPCSHELLTEST_HOME found" |
|
23 exit 1 |
|
24 fi |
|
25 |
|
26 echo "Detected Marionette home in $MARIONETTE_HOME" |
|
27 |
|
28 # If a GECKO_OBJDIR environemnt variable exists, we will create the Python |
|
29 # virtual envirnoment there. Otherwise we create it in the PWD. |
|
30 VENV_DIR="marionette_venv" |
|
31 if [ -z $GECKO_OBJDIR ] |
|
32 then |
|
33 VENV_DIR="$MARIONETTE_HOME/$VENV_DIR" |
|
34 else |
|
35 VENV_DIR="$GECKO_OBJDIR/$VENV_DIR" |
|
36 fi |
|
37 |
|
38 # Check if environment exists, if not, create a virtualenv: |
|
39 if [ -d $VENV_DIR ] |
|
40 then |
|
41 echo "Using virtual environment in $VENV_DIR" |
|
42 cd $VENV_DIR |
|
43 . bin/activate |
|
44 else |
|
45 echo "Creating a virtual environment in $VENV_DIR" |
|
46 curl https://raw.github.com/pypa/virtualenv/develop/virtualenv.py | ${PYTHON} - $VENV_DIR |
|
47 cd $VENV_DIR |
|
48 . bin/activate |
|
49 # set up mozbase |
|
50 git clone git://github.com/mozilla/mozbase.git |
|
51 cd mozbase |
|
52 python setup_development.py |
|
53 fi |
|
54 |
|
55 # update the marionette_client |
|
56 cd $MARIONETTE_HOME |
|
57 python setup.py develop |
|
58 |
|
59 cd $XPCSHELLTEST_HOME |
|
60 |
|
61 # pop off the python parameter |
|
62 shift |
|
63 python runtestsb2g.py $@ |