testing/xpcshell/b2g_xpcshell_venv.sh

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

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

mercurial