Commit b76b98b4 authored by John Zhang's avatar John Zhang

modules needed to run pytest under compiled pypy interpreter

parent 3d8fbc26
......@@ -83,6 +83,8 @@ def main_(argv=None):
config.objspace.suggest(allworkingmodules=False)
if config.objspace.allworkingmodules:
pypyoption.enable_allworkingmodules(config)
if config.objspace.pytestmodules:
pypyoption.enable_pytestmodules(config)
if config.objspace.usemodules._continuation:
config.translation.continuation = True
if config.objspace.usemodules.thread:
......
......@@ -56,6 +56,11 @@ translation_modules.update([
"termios", "_minimal_curses",
])
pytest_modules = translation_modules.copy()
pytest_modules.update([
'_collections', '_locale',
])
# XXX this should move somewhere else, maybe to platform ("is this posixish"
# check or something)
if sys.platform == "win32":
......@@ -163,6 +168,11 @@ pypy_optiondescription = OptionDescription("objspace", "Object Space Options", [
cmdline="--allworkingmodules",
negation=True),
BoolOption("pytestmodules", "modules needed to get basic pytest running",
default=False,
cmdline="--pytestmodules",
suggests=[("objspace.allworkingmodules", False)]),
StrOption("extmodules",
"Comma-separated list of third-party builtin modules",
cmdline="--ext",
......@@ -295,6 +305,10 @@ def enable_translationmodules(config):
modules = [name for name in modules if name not in essential_modules]
config.objspace.usemodules.suggest(**dict.fromkeys(modules, True))
def enable_pytestmodules(config):
modules = pytest_modules
modules = [name for name in modules if name not in essential_modules]
config.objspace.usemodules.suggest(**dict.fromkeys(modules, True))
if __name__ == '__main__':
config = get_pypy_config()
......
......@@ -231,6 +231,9 @@ class PyPyTarget(object):
if config.objspace.translationmodules:
from pypy.config.pypyoption import enable_translationmodules
enable_translationmodules(config)
if config.objspace.pytestmodules:
from pypy.config.pypyoption import enable_pytestmodules
enable_pytestmodules(config)
config.translation.suggest(check_str_without_nul=True)
config.translation.suggest(shared=True)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment