Run frozen smoke test via pytest.
This commit is contained in:
parent
ae07e00038
commit
7d6c39d64b
@ -14,5 +14,4 @@ test_script:
|
|||||||
- C:\Python34\Scripts\tox -e py34
|
- C:\Python34\Scripts\tox -e py34
|
||||||
- C:\Python34\Scripts\tox -e py34-integration
|
- C:\Python34\Scripts\tox -e py34-integration
|
||||||
- C:\Python34\Scripts\tox -e unittests-frozen
|
- C:\Python34\Scripts\tox -e unittests-frozen
|
||||||
- C:\Python34\Scripts\tox -e smoke-frozen
|
|
||||||
- C:\Python34\Scripts\tox -e pylint
|
- C:\Python34\Scripts\tox -e pylint
|
||||||
|
@ -101,26 +101,27 @@ bdist_mac_options = {
|
|||||||
'bundle_name': 'qutebrowser',
|
'bundle_name': 'qutebrowser',
|
||||||
}
|
}
|
||||||
|
|
||||||
if sys.platform.startswith('win'):
|
|
||||||
base = 'Win32GUI'
|
|
||||||
target_name = 'qutebrowser.exe'
|
|
||||||
else:
|
|
||||||
base = None
|
|
||||||
target_name = 'qutebrowser'
|
|
||||||
|
|
||||||
executable = cx.Executable('qutebrowser/__main__.py', base=base,
|
def get_exe(base, target_name):
|
||||||
targetName=target_name,
|
return cx.Executable('qutebrowser/__main__.py', base=base,
|
||||||
shortcutName='qutebrowser',
|
targetName=target_name, shortcutName='qutebrowser',
|
||||||
shortcutDir='ProgramMenuFolder',
|
shortcutDir='ProgramMenuFolder',
|
||||||
icon=os.path.join(BASEDIR, 'icons',
|
icon=os.path.join(BASEDIR, 'icons',
|
||||||
'qutebrowser.ico'))
|
'qutebrowser.ico'))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
if sys.platform.startswith('win'):
|
||||||
|
base = 'Win32GUI'
|
||||||
|
target_name = 'qutebrowser.exe'
|
||||||
|
else:
|
||||||
|
base = None
|
||||||
|
target_name = 'qutebrowser'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
setupcommon.write_git_file()
|
setupcommon.write_git_file()
|
||||||
cx.setup(
|
cx.setup(
|
||||||
executables=[executable],
|
executables=[get_exe(base, target_name)],
|
||||||
options={
|
options={
|
||||||
'build_exe': get_build_exe_options(),
|
'build_exe': get_build_exe_options(),
|
||||||
'bdist_msi': bdist_msi_options,
|
'bdist_msi': bdist_msi_options,
|
||||||
|
@ -69,12 +69,14 @@ def get_build_exe_options():
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Main entry point."""
|
"""Main entry point."""
|
||||||
|
base = 'Win32GUI' if sys.platform.startswith('win') else None
|
||||||
with temp_git_commit_file():
|
with temp_git_commit_file():
|
||||||
cx.setup(
|
cx.setup(
|
||||||
executables=[cx.Executable('scripts/dev/run_frozen_tests.py',
|
executables=[cx.Executable('scripts/dev/run_frozen_tests.py',
|
||||||
targetName='run-frozen-tests'),
|
targetName='run-frozen-tests'),
|
||||||
cx.Executable('tests/integration/webserver_sub.py',
|
cx.Executable('tests/integration/webserver_sub.py',
|
||||||
targetName='webserver_sub')],
|
targetName='webserver_sub'),
|
||||||
|
freeze.get_exe(base, target_name='qutebrowser')],
|
||||||
options={'build_exe': get_build_exe_options()},
|
options={'build_exe': get_build_exe_options()},
|
||||||
**setupcommon.setupdata
|
**setupcommon.setupdata
|
||||||
)
|
)
|
||||||
|
@ -21,13 +21,17 @@
|
|||||||
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
import os.path
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.not_frozen
|
|
||||||
def test_smoke():
|
def test_smoke():
|
||||||
argv = [sys.executable, '-m', 'qutebrowser', '--debug', '--no-err-windows',
|
if hasattr(sys, 'frozen'):
|
||||||
'--nowindow', '--temp-basedir', 'about:blank', ':later 500 quit']
|
argv = [os.path.join(os.path.dirname(sys.executable), 'qutebrowser')]
|
||||||
|
else:
|
||||||
|
argv = [sys.executable, '-m', 'qutebrowser']
|
||||||
|
argv += ['--debug', '--no-err-windows', '--nowindow', '--temp-basedir',
|
||||||
|
'about:blank', ':later 500 quit']
|
||||||
subprocess.check_call(argv)
|
subprocess.check_call(argv)
|
||||||
|
12
tox.ini
12
tox.ini
@ -176,18 +176,6 @@ commands =
|
|||||||
git --no-pager diff --exit-code --stat
|
git --no-pager diff --exit-code --stat
|
||||||
{envpython} scripts/asciidoc2html.py {posargs}
|
{envpython} scripts/asciidoc2html.py {posargs}
|
||||||
|
|
||||||
[testenv:smoke-frozen]
|
|
||||||
basepython = python3
|
|
||||||
passenv = {[testenv]passenv}
|
|
||||||
skip_install = true
|
|
||||||
deps =
|
|
||||||
{[testenv]deps}
|
|
||||||
cx_Freeze==4.3.4
|
|
||||||
commands =
|
|
||||||
{envpython} scripts/link_pyqt.py --tox {envdir}
|
|
||||||
{envpython} scripts/dev/freeze.py build_exe --qute-skip-html -b {envdir}/build
|
|
||||||
{envdir}/build/qutebrowser --no-err-windows --nowindow --temp-basedir about:blank ":later 500 quit"
|
|
||||||
|
|
||||||
[testenv:cxfreeze-windows]
|
[testenv:cxfreeze-windows]
|
||||||
# PYTHON is actually required when using this env, but the entire tox.ini would
|
# PYTHON is actually required when using this env, but the entire tox.ini would
|
||||||
# fail if we didn't have a fallback defined.
|
# fail if we didn't have a fallback defined.
|
||||||
|
Loading…
Reference in New Issue
Block a user