michael@0: #!/bin/bash michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: # You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: PYTHON=$1 michael@0: michael@0: if [ -z "${PYTHON}" ] michael@0: then michael@0: echo "No python found" michael@0: exit 1 michael@0: fi michael@0: michael@0: if [ -z "${MARIONETTE_HOME}" ] michael@0: then michael@0: echo "No MARIONETTE_HOME found" michael@0: exit 1 michael@0: fi michael@0: michael@0: if [ -z "${XPCSHELLTEST_HOME}" ] michael@0: then michael@0: echo "No XPCSHELLTEST_HOME found" michael@0: exit 1 michael@0: fi michael@0: michael@0: echo "Detected Marionette home in $MARIONETTE_HOME" michael@0: michael@0: # If a GECKO_OBJDIR environemnt variable exists, we will create the Python michael@0: # virtual envirnoment there. Otherwise we create it in the PWD. michael@0: VENV_DIR="marionette_venv" michael@0: if [ -z $GECKO_OBJDIR ] michael@0: then michael@0: VENV_DIR="$MARIONETTE_HOME/$VENV_DIR" michael@0: else michael@0: VENV_DIR="$GECKO_OBJDIR/$VENV_DIR" michael@0: fi michael@0: michael@0: # Check if environment exists, if not, create a virtualenv: michael@0: if [ -d $VENV_DIR ] michael@0: then michael@0: echo "Using virtual environment in $VENV_DIR" michael@0: cd $VENV_DIR michael@0: . bin/activate michael@0: else michael@0: echo "Creating a virtual environment in $VENV_DIR" michael@0: curl https://raw.github.com/pypa/virtualenv/develop/virtualenv.py | ${PYTHON} - $VENV_DIR michael@0: cd $VENV_DIR michael@0: . bin/activate michael@0: # set up mozbase michael@0: git clone git://github.com/mozilla/mozbase.git michael@0: cd mozbase michael@0: python setup_development.py michael@0: fi michael@0: michael@0: # update the marionette_client michael@0: cd $MARIONETTE_HOME michael@0: python setup.py develop michael@0: michael@0: cd $XPCSHELLTEST_HOME michael@0: michael@0: # pop off the python parameter michael@0: shift michael@0: python runtestsb2g.py $@