Browse Source

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/3485/merge
Paul Sokolovsky 7 years ago
parent
commit
016f830536
  1. 9
      tests/micropython/heapalloc.py
  2. 9
      tests/micropython/heapalloc_super.py

9
tests/micropython/heapalloc.py

@ -2,6 +2,15 @@
import micropython 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): def f1(a):
print(a) print(a)

9
tests/micropython/heapalloc_super.py

@ -1,6 +1,15 @@
# test super() operations which don't require allocation # test super() operations which don't require allocation
import micropython 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: class A:
def foo(self): def foo(self):
print('A foo') print('A foo')

Loading…
Cancel
Save