mirror of
https://github.com/servo/servo.git
synced 2025-09-04 12:08:21 +01:00
Update web-platform-tests and CSS tests.
- Update CSS tests to revision e05bfd5e30ed662c2f8a353577003f8eed230180. - Update web-platform-tests to revision a052787dd5c069a340031011196b73affbd68cd9.
This commit is contained in:
parent
fb4f421c8b
commit
296fa2512b
21852 changed files with 2080936 additions and 892894 deletions
|
@ -0,0 +1,64 @@
|
|||
"""
|
||||
Installs cx_freeze from source, but first patching
|
||||
setup.py as described here:
|
||||
|
||||
http://stackoverflow.com/questions/25107697/compiling-cx-freeze-under-ubuntu
|
||||
"""
|
||||
import glob
|
||||
import tarfile
|
||||
import os
|
||||
import sys
|
||||
import platform
|
||||
import py
|
||||
|
||||
if __name__ == '__main__':
|
||||
if 'ubuntu' not in platform.version().lower():
|
||||
|
||||
print('Not Ubuntu, installing using pip. (platform.version() is %r)' %
|
||||
platform.version())
|
||||
res = os.system('pip install cx_freeze')
|
||||
if res != 0:
|
||||
sys.exit(res)
|
||||
sys.exit(0)
|
||||
|
||||
rootdir = py.path.local.make_numbered_dir(prefix='cx_freeze')
|
||||
|
||||
res = os.system('pip install --download %s --no-use-wheel '
|
||||
'cx_freeze' % rootdir)
|
||||
if res != 0:
|
||||
sys.exit(res)
|
||||
|
||||
packages = glob.glob('%s/*.tar.gz' % rootdir)
|
||||
assert len(packages) == 1
|
||||
tar_filename = packages[0]
|
||||
|
||||
tar_file = tarfile.open(tar_filename)
|
||||
try:
|
||||
tar_file.extractall(path=str(rootdir))
|
||||
finally:
|
||||
tar_file.close()
|
||||
|
||||
basename = os.path.basename(tar_filename).replace('.tar.gz', '')
|
||||
setup_py_filename = '%s/%s/setup.py' % (rootdir, basename)
|
||||
with open(setup_py_filename) as f:
|
||||
lines = f.readlines()
|
||||
|
||||
line_to_patch = 'if not vars.get("Py_ENABLE_SHARED", 0):'
|
||||
for index, line in enumerate(lines):
|
||||
if line_to_patch in line:
|
||||
indent = line[:line.index(line_to_patch)]
|
||||
lines[index] = indent + 'if True:\n'
|
||||
print('Patched line %d' % (index + 1))
|
||||
break
|
||||
else:
|
||||
sys.exit('Could not find line in setup.py to patch!')
|
||||
|
||||
with open(setup_py_filename, 'w') as f:
|
||||
f.writelines(lines)
|
||||
|
||||
os.chdir('%s/%s' % (rootdir, basename))
|
||||
res = os.system('python setup.py install')
|
||||
if res != 0:
|
||||
sys.exit(res)
|
||||
|
||||
sys.exit(0)
|
|
@ -0,0 +1,9 @@
|
|||
"""
|
||||
This is the script that is actually frozen into an executable: simply executes
|
||||
py.test main().
|
||||
"""
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
import pytest
|
||||
sys.exit(pytest.main())
|
|
@ -0,0 +1,15 @@
|
|||
"""
|
||||
Sample setup.py script that generates an executable with pytest runner embedded.
|
||||
"""
|
||||
if __name__ == '__main__':
|
||||
from cx_Freeze import setup, Executable
|
||||
import pytest
|
||||
|
||||
setup(
|
||||
name="runtests",
|
||||
version="0.1",
|
||||
description="exemple of how embedding py.test into an executable using cx_freeze",
|
||||
executables=[Executable("runtests_script.py")],
|
||||
options={"build_exe": {'includes': pytest.freeze_includes()}},
|
||||
)
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
Testing doctest::
|
||||
|
||||
>>> 1 + 1
|
||||
2
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
def test_upper():
|
||||
assert 'foo'.upper() == 'FOO'
|
||||
|
||||
def test_lower():
|
||||
assert 'FOO'.lower() == 'foo'
|
|
@ -0,0 +1,15 @@
|
|||
"""
|
||||
Called by tox.ini: uses the generated executable to run the tests in ./tests/
|
||||
directory.
|
||||
|
||||
.. note:: somehow calling "build/runtests_script" directly from tox doesn't
|
||||
seem to work (at least on Windows).
|
||||
"""
|
||||
if __name__ == '__main__':
|
||||
import os
|
||||
import sys
|
||||
|
||||
executable = os.path.join(os.getcwd(), 'build', 'runtests_script')
|
||||
if sys.platform.startswith('win'):
|
||||
executable += '.exe'
|
||||
sys.exit(os.system('%s tests' % executable))
|
Loading…
Add table
Add a link
Reference in a new issue