[pypy-svn] r45321 - in pypy/dist/pypy/rpython/module: . test
fijal at codespeak.net
fijal at codespeak.net
Wed Jul 25 12:35:15 CEST 2007
Author: fijal
Date: Wed Jul 25 12:35:14 2007
New Revision: 45321
Modified:
pypy/dist/pypy/rpython/module/ll_os.py
pypy/dist/pypy/rpython/module/test/test_ll_os.py
pypy/dist/pypy/rpython/module/test/test_posix.py
Log:
Fix the os.uname and test it on top of ctypes now.
Modified: pypy/dist/pypy/rpython/module/ll_os.py
==============================================================================
--- pypy/dist/pypy/rpython/module/ll_os.py (original)
+++ pypy/dist/pypy/rpython/module/ll_os.py Wed Jul 25 12:35:14 2007
@@ -133,11 +133,8 @@
('nodename', UTCHARP),
('release', UTCHARP),
('version', UTCHARP),
- ('machine', UTCHARP)]
- # heh, that's a valid question whether asking for defines NOW
- # makes any sense
- if platform.defined('_GNU_SOURCE'):
- fields.append('domainname', UTCHARP)
+ ('machine', UTCHARP),
+ ('domainname', UTCHARP)]
UTSNAMEP = rffi.CStruct('utsname', *fields)
os_uname = rffi.llexternal('uname', [UTSNAMEP], rffi.INT,
Modified: pypy/dist/pypy/rpython/module/test/test_ll_os.py
==============================================================================
--- pypy/dist/pypy/rpython/module/test/test_ll_os.py (original)
+++ pypy/dist/pypy/rpython/module/test/test_ll_os.py Wed Jul 25 12:35:14 2007
@@ -113,16 +113,6 @@
for value in [0, 1, 127, 128, 255]:
assert fn(value) == fun(value)
-def test_os_uname():
- if not hasattr(os, 'uname'):
- py.test.skip("os.uname does not exist")
- from pypy.translator.c.test.test_genc import compile
- for num in range(5):
- def fun():
- return os.uname()[num]
- fn = compile(fun, [])
- assert fn() == os.uname()[num]
-
class ExpectTestOs:
def setup_class(cls):
if not hasattr(os, 'ttyname'):
Modified: pypy/dist/pypy/rpython/module/test/test_posix.py
==============================================================================
--- pypy/dist/pypy/rpython/module/test/test_posix.py (original)
+++ pypy/dist/pypy/rpython/module/test/test_posix.py Wed Jul 25 12:35:14 2007
@@ -110,13 +110,11 @@
class TestLLtype(BaseTestPosix, LLRtypeMixin):
if hasattr(os, 'uname'):
def test_os_uname(self):
- py.test.skip("Cannot do it (yet) because ll2ctypes cannot handle str -> fixedsizearray")
- #from pypy.translator.c.test.test_genc import compile
for num in range(5):
def fun():
return os.uname()[num]
- #fn = compile(fun, [])
- assert self.interpret(fun, []) == os.uname()[num]
+ res = self.interpret(fun, [])
+ assert self.ll_to_string(res) == os.uname()[num]
class TestOOtype(BaseTestPosix, OORtypeMixin):
pass
More information about the Pypy-commit
mailing list