Commits

Ronny Pfannschmidt committed 263956c

move the test jit/translation graph viewing options to a own plugin to external code can use it

Comments (0)

Files changed (3)

 
 def pytest_addoption(parser):
     group = parser.getgroup("pypy options")
-    group.addoption('--view', action="store_true", dest="view", default=False,
-           help="view translation tests' flow graphs with Pygame")
     group.addoption('-A', '--runappdirect', action="store_true",
            default=False, dest="runappdirect",
            help="run applevel tests directly on python interpreter (not through PyPy)")
     group.addoption('-P', '--platform', action="callback", type="string",
            default="host", callback=_set_platform,
            help="set up tests to use specified platform as compile/run target")
-    group = parser.getgroup("JIT options")
-    group.addoption('--viewloops', action="store_true",
-           default=False, dest="viewloops",
-           help="show only the compiled loops")
 
 def pytest_sessionstart():
     # have python subprocesses avoid startup customizations by default

pypy/tool/pytest/viewerplugin.py

+"""
+    pypy.tool.pytest.viewerplugin
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+    this pytest plugin is support code for
+    testsuites using translation flowgraphs
+    or jit loop graphs.
+
+    it can be enabled by
+    
+    * adding the module name to pytest_plugins in a conftest
+    * putting "-p pypy.tool.pytest.viewerplugin"
+      into pytest.ini
+"""
+
+
+def pytest_addoption(parser):
+
+    group = parser.getgroup("pypy options")
+    group.addoption('--view', action="store_true", dest="view", default=False,
+           help="view translation tests' flow graphs with Pygame")
+
+    group = parser.getgroup("JIT options")
+    group.addoption('--viewloops', action="store_true",
+           default=False, dest="viewloops",
+           help="show only the compiled loops")
 [pytest]
-addopts = --assert=reinterp -rf
+addopts =
+    --assert=reinterp -rf
+    -p pypy.tool.pytest.viewerplugin