gecko/testing/tps/INSTALL.sh
Jonathan Griffin 513009edb0 Bug 678628 - allow TPS to run Mozmill tests, f=philikon, a=testonly, DONTBUILD
--HG--
rename : services/sync/tps/chrome.manifest => services/sync/tps/extensions/tps/chrome.manifest
rename : services/sync/tps/components/tps-cmdline.js => services/sync/tps/extensions/tps/components/tps-cmdline.js
rename : services/sync/tps/install.rdf => services/sync/tps/extensions/tps/install.rdf
rename : services/sync/tps/modules/bookmarks.jsm => services/sync/tps/extensions/tps/modules/bookmarks.jsm
rename : services/sync/tps/modules/forms.jsm => services/sync/tps/extensions/tps/modules/forms.jsm
rename : services/sync/tps/modules/history.jsm => services/sync/tps/extensions/tps/modules/history.jsm
rename : services/sync/tps/modules/logger.jsm => services/sync/tps/extensions/tps/modules/logger.jsm
rename : services/sync/tps/modules/passwords.jsm => services/sync/tps/extensions/tps/modules/passwords.jsm
rename : services/sync/tps/modules/prefs.jsm => services/sync/tps/extensions/tps/modules/prefs.jsm
rename : services/sync/tps/modules/quit.js => services/sync/tps/extensions/tps/modules/quit.js
rename : services/sync/tps/modules/tabs.jsm => services/sync/tps/extensions/tps/modules/tabs.jsm
rename : services/sync/tps/modules/tps.jsm => services/sync/tps/extensions/tps/modules/tps.jsm
extra : rebase_source : d4eed9a707ffe801de9b1bb4e6f08d31e670eec4
2011-08-22 14:27:25 -07:00

91 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
# This scripts sets up a virutalenv and installs TPS into it.
# It's probably best to specify a path NOT inside the repo, otherwise
# all the virtualenv files will show up in e.g. hg status.
# get target directory
if [ ! -z "$1" ]
then
TARGET=$1
else
echo "Usage: INSTALL.sh /path/to/create/virtualenv [/path/to/python2.6]"
exit 1
fi
# decide which python to use
if [ ! -z "$2" ]
then
PYTHON=$2
else
PYTHON=`which python`
fi
if [ -z "${PYTHON}" ]
then
echo "No python found"
exit 1
fi
CWD="`pwd`"
# create the destination directory
mkdir ${TARGET}
if [ "$?" -gt 0 ]
then
exit 1
fi
if [ "${OS}" = "Windows_NT" ]
then
BIN_NAME=Scripts/activate
else
BIN_NAME=bin/activate
fi
# Create a virtualenv:
curl https://raw.github.com/jonallengriffin/virtualenv/msys/virtualenv.py | ${PYTHON} - ${TARGET}
cd ${TARGET}
. $BIN_NAME
if [ -z "${VIRTUAL_ENV}" ]
then
echo "virtualenv wasn't installed correctly, aborting"
exit 1
fi
# install TPS
cd ${CWD}
python setup.py install
if [ "$?" -gt 0 ]
then
exit 1
fi
CONFIG="`find ${VIRTUAL_ENV} -name config.json.in`"
NEWCONFIG=${CONFIG:0:${#CONFIG}-3}
cd "../../services/sync/tests/tps"
TESTDIR="`pwd`"
cd "../../tps/extensions"
EXTDIR="`pwd`"
sed 's|__TESTDIR__|'"${TESTDIR}"'|' "${CONFIG}" | sed 's|__EXTENSIONDIR__|'"${EXTDIR}"'|' > "${NEWCONFIG}"
rm ${CONFIG}
echo
echo "***********************************************************************"
echo
echo "To run TPS, activate the virtualenv using:"
echo " source ${TARGET}/${BIN_NAME}"
echo "then execute tps using:"
echo " runtps --binary=/path/to/firefox"
echo
echo "See runtps --help for all options"
echo
echo "To change your TPS config, please edit the file: "
echo "${NEWCONFIG}"
echo
echo "***********************************************************************"