testing/xpcshell/b2g_xpcshell_venv.sh

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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/.
     6 PYTHON=$1
     8 if [ -z "${PYTHON}" ]
     9 then
    10     echo "No python found"
    11     exit 1
    12 fi
    14 if [ -z "${MARIONETTE_HOME}" ]
    15 then
    16     echo "No MARIONETTE_HOME found"
    17     exit 1
    18 fi
    20 if [ -z "${XPCSHELLTEST_HOME}" ]
    21 then
    22     echo "No XPCSHELLTEST_HOME found"
    23     exit 1
    24 fi
    26 echo "Detected Marionette home in $MARIONETTE_HOME"
    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
    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
    55 # update the marionette_client
    56 cd $MARIONETTE_HOME
    57 python setup.py develop
    59 cd $XPCSHELLTEST_HOME
    61 # pop off the python parameter
    62 shift
    63 python runtestsb2g.py $@

mercurial