[pypy-dev] PPC patch for windows

Ben.Young at risk.sungard.com Ben.Young at risk.sungard.com
Tue Oct 18 11:40:44 CEST 2005


Hi Everyone,

The test skip code for ppc asm wasn't working properly. Here's a patch 
that gets rid of the test failures (inline as attachments are 
problematic):

Index: translator/asm/ppcgen/test/test_func_builder.py
===================================================================
--- translator/asm/ppcgen/test/test_func_builder.py     (revision 18731)
+++ translator/asm/ppcgen/test/test_func_builder.py     (working copy)
@@ -2,6 +2,7 @@

 import random, sys, os

+import py
 from pypy.translator.asm.ppcgen.ppc_assembler import MyPPCAssembler
 from pypy.translator.asm.ppcgen.symbol_lookup import lookup
 from pypy.translator.asm.ppcgen.func_builder import make_func
@@ -10,7 +11,7 @@

 class TestFuncBuilderTest(object):
     def setup_class(cls):
-        if os.uname()[-1] != 'Power Macintosh':
+        if not hasattr(os, "uname") or os.uname()[-1] != 'Power 
Macintosh':
             py.test.skip("can't test all of ppcgen on non-PPC!")

     def test_simple(self):
Index: translator/asm/ppcgen/test/test_ppc.py
===================================================================
--- translator/asm/ppcgen/test/test_ppc.py      (revision 18731)
+++ translator/asm/ppcgen/test/test_ppc.py      (working copy)
@@ -1,5 +1,6 @@
 import random, sys, os

+import py
 from pypy.translator.asm.ppcgen.ppc_assembler import BasicPPCAssembler, 
MyPPCAssembler
 from pypy.translator.asm.ppcgen.symbol_lookup import lookup
 from pypy.translator.asm.ppcgen.regname import *
@@ -18,7 +19,7 @@
 class TestAssemble(object):

     def setup_class(cls):
-        if os.uname()[-1] != 'Power Macintosh':
+        if not hasattr(os, "uname") or os.uname()[-1] != 'Power 
Macintosh':
             py.test.skip("can't test all of ppcgen on non-PPC!")

     def test_tuplelength(self):



More information about the Pypy-dev mailing list