[pypy-svn] r24286 - in pypy/dist/pypy/translator/squeak: . test

nik at codespeak.net nik at codespeak.net
Mon Mar 13 12:49:25 CET 2006


Author: nik
Date: Mon Mar 13 12:49:24 2006
New Revision: 24286

Added:
   pypy/dist/pypy/translator/squeak/conftest.py
Modified:
   pypy/dist/pypy/translator/squeak/test/runtest.py
Log:
add a py.test option to not run squeak headless, for convenience when
debugging generated squeak code.


Added: pypy/dist/pypy/translator/squeak/conftest.py
==============================================================================
--- (empty file)
+++ pypy/dist/pypy/translator/squeak/conftest.py	Mon Mar 13 12:49:24 2006
@@ -0,0 +1,8 @@
+import py
+
+Option = py.test.Config.Option
+
+option = py.test.Config.addoptions("pypy-squeak options", 
+        Option('--showsqueak', action="store_true", dest="showsqueak", 
+               default=False, help="don't run squeak headless, for debugging"),
+    )

Modified: pypy/dist/pypy/translator/squeak/test/runtest.py
==============================================================================
--- pypy/dist/pypy/translator/squeak/test/runtest.py	(original)
+++ pypy/dist/pypy/translator/squeak/test/runtest.py	Mon Mar 13 12:49:24 2006
@@ -72,8 +72,11 @@
             py.test.skip("Squeak tests expect the SQUEAK_IMAGE environment "
                     "variable to point to an image.")
         startup_st = self._write_startup()
-        cmd = 'squeak -headless -- %s %s "%s" %s' \
-                % (startup_st, udir.join(self._gen.filename),
+        options = "-headless"
+        if conftest.option.showsqueak:
+            options = ""
+        cmd = 'squeak %s -- %s %s "%s" %s' \
+                % (options, startup_st, udir.join(self._gen.filename),
                    Selector(self._func.__name__, len(args)).symbol(),
                    " ".join(['"%s"' % a for a in args]))
         squeak_process = os.popen(cmd)



More information about the Pypy-commit mailing list