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).
pull/1/head
Paul Sokolovsky 2017-12-11 11:58:44 +02:00
parent e02cb9ec31
commit 016f830536
2 changed files with 18 additions and 0 deletions

View File

@ -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)

View File

@ -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')