[pypy-svn] r51519 - pypy/dist/pypy/translator/c/gcc/test

arigo at codespeak.net arigo at codespeak.net
Fri Feb 15 13:07:46 CET 2008


Author: arigo
Date: Fri Feb 15 13:07:45 2008
New Revision: 51519

Modified:
   pypy/dist/pypy/translator/c/gcc/test/test_asmgcroot.py
Log:
Fix test (needs to support string results).


Modified: pypy/dist/pypy/translator/c/gcc/test/test_asmgcroot.py
==============================================================================
--- pypy/dist/pypy/translator/c/gcc/test/test_asmgcroot.py	(original)
+++ pypy/dist/pypy/translator/c/gcc/test/test_asmgcroot.py	Fri Feb 15 13:07:45 2008
@@ -19,7 +19,10 @@
             except MemoryError:
                 print 'Result: MemoryError'
             else:
-                print 'Result:', res
+                if isinstance(res, int):
+                    print 'Result:', res
+                else:
+                    print 'Result: "%s"' % (res,)
             return 0
         from pypy.config.pypyoption import get_pypy_config
         config = get_pypy_config(translating=True)
@@ -54,6 +57,8 @@
             result = lines[-1][len('Result:'):].strip()
             if result == 'MemoryError':
                 raise MemoryError("subprocess got an RPython MemoryError")
+            if result.startswith('"') and result.endswith('"'):
+                return result[1:-1]
             else:
                 return int(result)
         return run



More information about the Pypy-commit mailing list