Add mintty to Windows environment and fix other issues
This commit is contained in:
Родитель
c500611d48
Коммит
d3828f8133
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
MOZMILL_VERSION=$1
|
MOZMILL_VERSION=$1
|
||||||
|
|
||||||
VIRTUALENV_URL=https://bitbucket.org/ianb/virtualenv/raw/tip/virtualenv.py
|
VIRTUALENV_URL=https://bitbucket.org/ianb/virtualenv/raw/1.5.2/virtualenv.py
|
||||||
|
|
||||||
ENV_DIR=mozmill-env
|
ENV_DIR=mozmill-env
|
||||||
PYTHON_VERSION=$(python -c "import sys;print sys.version[:3]")
|
PYTHON_VERSION=$(python -c "import sys;print sys.version[:3]")
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
MOZMILL_VERSION=$1
|
MOZMILL_VERSION=$1
|
||||||
|
|
||||||
VIRTUALENV_URL=https://bitbucket.org/ianb/virtualenv/raw/tip/virtualenv.py
|
VIRTUALENV_URL=https://bitbucket.org/ianb/virtualenv/raw/1.5.2/virtualenv.py
|
||||||
|
|
||||||
ENV_DIR=mozmill-env
|
ENV_DIR=mozmill-env
|
||||||
PYTHON_VERSION=$(python -c "import sys;print sys.version[:3]")
|
PYTHON_VERSION=$(python -c "import sys;print sys.version[:3]")
|
||||||
|
|
|
@ -8,9 +8,11 @@ import subprocess
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
import urllib
|
import urllib
|
||||||
|
import zipfile
|
||||||
|
|
||||||
|
|
||||||
URL_MSYS = "http://sourceforge.net/projects/mingw/files/MSYS/BaseSystem/msys-core/msys-1.0.11/MSYS-1.0.11.exe/download"
|
URL_MSYS = "http://sourceforge.net/projects/mingw/files/MSYS/BaseSystem/msys-core/msys-1.0.11/MSYS-1.0.11.exe/download"
|
||||||
|
URL_MINTTY = "http://mintty.googlecode.com/files/mintty-1.0.1-msys.zip"
|
||||||
URL_VIRTUALENV = "https://bitbucket.org/ianb/virtualenv/raw/1.5.2/virtualenv.py"
|
URL_VIRTUALENV = "https://bitbucket.org/ianb/virtualenv/raw/1.5.2/virtualenv.py"
|
||||||
|
|
||||||
base_dir = os.path.abspath(os.path.dirname(__file__))
|
base_dir = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
@ -42,16 +44,14 @@ def make_relocatable(filepath):
|
||||||
for file in files:
|
for file in files:
|
||||||
for line in fileinput.input(file, inplace=1):
|
for line in fileinput.input(file, inplace=1):
|
||||||
if fileinput.isfirstline() and line.startswith("#!"):
|
if fileinput.isfirstline() and line.startswith("#!"):
|
||||||
print "#!python"
|
# Only on Windows we have to set Python into unbuffered mode
|
||||||
|
print "#!python -u"
|
||||||
else:
|
else:
|
||||||
print line,
|
print line,
|
||||||
|
|
||||||
fileinput.close()
|
fileinput.close()
|
||||||
|
|
||||||
|
|
||||||
make_relocatable("%s\\Scripts\\*.py" % (python_dir))
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
parser = optparse.OptionParser()
|
parser = optparse.OptionParser()
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
|
@ -70,11 +70,18 @@ download(URL_MSYS, setup_msys)
|
||||||
subprocess.call([ setup_msys, '/VERYSILENT', '/SP-', '/DIR=%s' % (msys_dir),
|
subprocess.call([ setup_msys, '/VERYSILENT', '/SP-', '/DIR=%s' % (msys_dir),
|
||||||
'/NOICONS' ])
|
'/NOICONS' ])
|
||||||
|
|
||||||
|
print "Download and install 'mintty'"
|
||||||
|
mintty_path = os.path.join(download_dir, os.path.basename(URL_MINTTY))
|
||||||
|
download(URL_MINTTY, mintty_path)
|
||||||
|
zip = zipfile.ZipFile(mintty_path, "r")
|
||||||
|
zip.extract("mintty.exe", "%s\\bin" % (msys_dir))
|
||||||
|
zip.close()
|
||||||
|
|
||||||
print "Copy template files into environment"
|
print "Copy template files into environment"
|
||||||
os.system("xcopy /S /I /F %s %s" % (template_dir, env_dir))
|
os.system("xcopy /S /I /H %s %s" % (template_dir, env_dir))
|
||||||
|
|
||||||
print "Copy Python installation (including pythonXX.dll into environment"
|
print "Copy Python installation (including pythonXX.dll into environment"
|
||||||
os.system("xcopy /S /I %s %s\\python" % (sys.prefix, env_dir))
|
os.system("xcopy /S /I /H %s %s\\python" % (sys.prefix, env_dir))
|
||||||
os.system("xcopy %s\\system32\\python*.dll %s" % (os.environ['WINDIR'], python_dir))
|
os.system("xcopy %s\\system32\\python*.dll %s" % (os.environ['WINDIR'], python_dir))
|
||||||
|
|
||||||
print "Download 'virtualenv' and create new virtual environment"
|
print "Download 'virtualenv' and create new virtual environment"
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
BoldAsFont=no
|
||||||
|
FontHeight=10
|
||||||
|
CursorType=line
|
||||||
|
CursorBlinks=yes
|
||||||
|
Locale=C
|
||||||
|
Charset=UTF-8
|
|
@ -0,0 +1,2 @@
|
||||||
|
echo "Welcome to the interactive Mozmill shell."
|
||||||
|
echo "Run 'mozmill --help' for assistance."
|
|
@ -1,13 +1,11 @@
|
||||||
Test environment for Mozmill test execution via the command line on Windows.
|
Test environment for Mozmill test execution via the command line on Windows.
|
||||||
|
|
||||||
Note: Configure the environment before the first use by running setup.cmd.
|
Note: Configure the environment before the first use by running setup.cmd.
|
||||||
|
|
||||||
|
Usage
|
||||||
Usage
|
=====
|
||||||
====
|
The start script can be used manually or scripted. For the latter mode, parameters have to be passed in. The maximum number of allowed
|
||||||
The start script can be used manually or scripted. For the latter mode,
|
parameters is 9.
|
||||||
parameters have to be passed in. The maximum number of allowed
|
|
||||||
parameters is 9.
|
Manual: run.cmd
|
||||||
|
Scripted: run.cmd mozmill -b c:\firefox\firefox.exe -t c:\mozmill-tests\firefox
|
||||||
Manual: run.cmd
|
|
||||||
Scripted: run.cmd mozmill -b c:\firefox\firefox.exe -t c:\mozmill-tests\firefox
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
SET ENV_DRIVE=%~d0%
|
SET ENV_DRIVE=%~d0%
|
||||||
SET ENV_PATH=%~p0%
|
SET ENV_PATH=%~p0%
|
||||||
SET ENV=%ENV_DRIVE%%ENV_PATH%
|
SET ENV=%ENV_DRIVE%%ENV_PATH%
|
||||||
SET SHELL=%ENV%\\msys\\bin\\bash --login
|
|
||||||
|
|
||||||
SET PATH=%PATH%;%ENV%\\python\\;%ENV%\\python\\Scripts
|
SET PATH=%PATH%;%ENV%\\python\\;%ENV%\\python\\Scripts
|
||||||
SET PYTHONPATH=%ENV%\\python\\Lib
|
SET PYTHONPATH=%ENV%\\python\\Lib
|
||||||
|
@ -11,11 +10,10 @@ SET PYTHONPATH=%ENV%\\python\\Lib
|
||||||
SET HOME=%ENV%
|
SET HOME=%ENV%
|
||||||
|
|
||||||
IF %1!==! goto interactive
|
IF %1!==! goto interactive
|
||||||
%SHELL% -c "%*"
|
%ENV%\\msys\\bin\\bash --login -c "%*"
|
||||||
goto end
|
goto end
|
||||||
|
|
||||||
:interactive
|
:interactive
|
||||||
echo "Welcome to Mozmill. Use 'mozmill --help' for assistance.
|
start %ENV%\\msys\\bin\\mintty /bin/bash -l
|
||||||
start "" %SHELL% -i
|
|
||||||
|
|
||||||
:end
|
:end
|
||||||
|
|
Загрузка…
Ссылка в новой задаче