tests/heapalloc, heapalloc_super: Skip in strict stackless mode.
These tests involves testing allocation-free function calling, and in strict stackless mode, it's not possible to make a function call with heap locked (because function activation record aka frame is allocated on the heap).
This commit is contained in:
parent
e02cb9ec31
commit
016f830536
|
@ -2,6 +2,15 @@
|
|||
|
||||
import micropython
|
||||
|
||||
# Check for stackless build, which can't call functions without
|
||||
# allocating a frame on heap.
|
||||
try:
|
||||
def stackless(): pass
|
||||
micropython.heap_lock(); stackless(); micropython.heap_unlock()
|
||||
except RuntimeError:
|
||||
print("SKIP")
|
||||
raise SystemExit
|
||||
|
||||
def f1(a):
|
||||
print(a)
|
||||
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
# test super() operations which don't require allocation
|
||||
import micropython
|
||||
|
||||
# Check for stackless build, which can't call functions without
|
||||
# allocating a frame on heap.
|
||||
try:
|
||||
def stackless(): pass
|
||||
micropython.heap_lock(); stackless(); micropython.heap_unlock()
|
||||
except RuntimeError:
|
||||
print("SKIP")
|
||||
raise SystemExit
|
||||
|
||||
class A:
|
||||
def foo(self):
|
||||
print('A foo')
|
||||
|
|
Loading…
Reference in New Issue