Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mu-impl-fast
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
40
Issues
40
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
mu
mu-impl-fast
Commits
e905a7af
Commit
e905a7af
authored
Nov 28, 2016
by
John Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added some heap tests; modified framework to include heap initialisation for python test scripts
parent
f650f6ae
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
251 additions
and
4 deletions
+251
-4
test_heap.py
tests/test_jit/test_heap.py
+245
-0
test_rpython.py
tests/test_jit/test_rpython.py
+3
-3
util.py
tests/test_jit/util.py
+3
-1
No files found.
tests/test_jit/test_heap.py
0 → 100644
View file @
e905a7af
This diff is collapsed.
Click to expand it.
tests/test_jit/test_rpython.py
View file @
e905a7af
...
...
@@ -575,7 +575,7 @@ def test_threadtran_fib():
"result_type"
:
i64
}
fnp
,
(
mu
,
ctx
,
bldr
)
=
fncptr_from_py_script
(
build_test_bundle
,
'fib'
,
[
ctypes
.
c_longlong
])
fnp
,
(
mu
,
ctx
,
bldr
)
=
fncptr_from_py_script
(
build_test_bundle
,
None
,
'fib'
,
[
ctypes
.
c_longlong
])
mu
.
current_thread_as_mu_thread
(
rmu
.
null
(
rmu
.
MuCPtr
))
...
...
@@ -646,7 +646,7 @@ def test_new():
"@i64"
:
i64
}
fnp
,
(
mu
,
ctx
,
bldr
)
=
fncptr_from_py_script
(
build_test_bundle
,
'test_fnc'
)
fnp
,
(
mu
,
ctx
,
bldr
)
=
fncptr_from_py_script
(
build_test_bundle
,
None
,
'test_fnc'
)
mu
.
current_thread_as_mu_thread
(
rmu
.
null
(
rmu
.
MuCPtr
))
assert
fnp
()
==
1
...
...
@@ -712,7 +712,7 @@ def test_new_cmpeq():
"@i64"
:
i64
}
fnp
,
(
mu
,
ctx
,
bldr
)
=
fncptr_from_py_script
(
build_test_bundle
,
'test_fnc'
)
fnp
,
(
mu
,
ctx
,
bldr
)
=
fncptr_from_py_script
(
build_test_bundle
,
None
,
'test_fnc'
)
mu
.
current_thread_as_mu_thread
(
rmu
.
null
(
rmu
.
MuCPtr
))
assert
fnp
()
==
0
...
...
tests/test_jit/util.py
View file @
e905a7af
...
...
@@ -66,7 +66,7 @@ def fncptr_from_c_script(c_src_name, name, argtypes=[], restype=ctypes.c_ulonglo
return
fncptr_from_lib
(
lib
,
name
,
argtypes
,
restype
),
lib
def
fncptr_from_py_script
(
py_fnc
,
name
,
argtypes
=
[],
restype
=
ctypes
.
c_longlong
):
def
fncptr_from_py_script
(
py_fnc
,
heapinit_fnc
,
name
,
argtypes
=
[],
restype
=
ctypes
.
c_longlong
):
import
os
# NOTE: requires mu-client-pypy
from
rpython.rlib
import
rmu_fast
as
rmu
...
...
@@ -82,6 +82,8 @@ def fncptr_from_py_script(py_fnc, name, argtypes=[], restype=ctypes.c_longlong):
id_dict
=
py_fnc
(
bldr
,
rmu
)
bldr
.
load
()
if
heapinit_fnc
:
heapinit_fnc
(
ctx
,
id_dict
,
rmu
)
libpath
=
py
.
path
.
local
(
'lib
%(name)
s.dylib'
%
locals
())
mu
.
compile_to_sharedlib
(
libpath
.
strpath
,
[])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment