Hi Everyone,
Just synced to head this morning and noticed a couple of errors in the c
translation process.
This first is that on windows, a couple of headers are not available. I
fixed this by patching locally with:
Index: translator/c/extfunc_include.h
===================================================================
--- translator/c/extfunc_include.h (revision 14483)
+++ translator/c/extfunc_include.h (working copy)
@@ -6,9 +6,9 @@
/******************************************************************/
-#include <unistd.h>
+/*#include <unistd.h>
#include <sys/types.h>
-#include <sys/stat.h>
+#include <sys/stat.h>*/
#include <fcntl.h>
#include <time.h>
#ifndef PATH_MAX
Then, when the tests are run I get:
$ ./test_all.py translator/c/
============================= test process starts
=============================
testing-mode: inprocess
executable: c:\Python24\python.exe (2.4.1-final-0)
using py lib: c:\Documents and Settings\YoungB\dist\py <rev unknown>
translator\c\test\test_annotated.py[19] ...................
translator\c\test\test_backendoptimized.py[39]
.......................................
translator\c\test\test_database.py[17] .................
translator\c\test\test_exception.py[3] ...
translator\c\test\test_extfunc.py[4] F...
translator\c\test\test_genc.py[8] ........
translator\c\test\test_lltyped.py[2] ..
translator\c\test\test_notype.py[33] .................................
translator\c\test\test_operation.py[1] .
translator\c\test\test_support.py[7] .......
translator\c\test\test_symboltable.py[1] .
translator\c\test\test_typed.py[38] ......................................
_______________________________________________________________________________
_________________________ entrypoint: test_time_clock
_________________________
def test_time_clock():
def does_stuff():
return time.clock()
f1 = compile(does_stuff, [])
t0 = time.clock()
t1 = f1()
assert type(t1) is float
t2 = time.clock()
E assert t0 <= t1 <= t2
> assert 165.0 <= 2.5683609740123038e-005
[c:\Documents and
Settings\YoungB\dist\pypy\translator\c\test\test_extfunc.py:16]
- - - - - - - - - - - test_time_clock: recorded stderr - - - - - - - - -
- - -
[annrpython] (pypy.translator.c.test.test_extfunc:9) does_stuff ->
SomeFloat()
[annrpython] (pypy.rpython.rclass:575) ll_runtime_type_info__objectPtr ->
SomePtr(ll_ptrtype=<* RuntimeTypeInfo (opaque)>)
[annrpython] (pypy.rpython.module.ll_time:14) ll_time_clock -> SomeFloat()
[annrpython] (pypy.rpython.rclass:568)
ll_issubclass__object_vtablePtr_object_vtablePtr -> SomeBool(const=True)
[annrpython] (pypy.rpython.rclass:568)
ll_issubclass__object_vtablePtr_object_vtablePtr -> SomeBool()
[annrpython] (pypy.rpython.rclass:565) ll_type__objectPtr ->
SomePtr(ll_ptrtype=<* Struct object_vtable { parenttypeptr: * Struct objec
t_vtable { ... }, rtti: * RuntimeTypeInfo (opaque), name: * Array of Char
}>)
[annrpython] (pypy.rpython.exceptiondata:120)
ll_pyexcclass2exc__PyObjectPtr -> SomePtr(const=<* struct object {
typeptr=... }>, ll_ptr
type=<* GcStruct object { typeptr: * Struct object_vtable { parenttypeptr:
* Struct object_vtable { ... }, rtti: * RuntimeTypeInfo (opa
que), name: * Array of Char } }>)
[annrpython] (pypy.rpython.exceptiondata:120)
ll_pyexcclass2exc__PyObjectPtr -> SomePtr(ll_ptrtype=<* GcStruct object {
typeptr: * Stru
ct object_vtable { parenttypeptr: * Struct object_vtable { ... }, rtti: *
RuntimeTypeInfo (opaque), name: * Array of Char } }>)
[annrpython] (pypy.rpython.exceptiondata:53) ll_raise_OSError__Signed ->
SomeImpossibleValue()
_______________________________________________________________________________
=========== tests finished: 171 passed, 1 failed in 263.86 seconds
============
I think this is because when clock is called in the extension it thinks it
is the first time and returns the very small value. I don't really know
though.
I hope you all had fun at the sprint!
Cheers,
Ben
_______________________________________________
[email protected]
http://codespeak.net/mailman/listinfo/pypy-dev