diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-12-11 11:58:44 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-12-11 12:04:59 +0200 |
commit | 016f83053669ee56561bebd8e9b65dac77b670ac (patch) | |
tree | 3c5ee8d3411c5736e766779078ad7f4a9ff26227 | |
parent | e02cb9ec318580497dbb17f369a61d9e932094e5 (diff) |
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).
-rw-r--r-- | tests/micropython/heapalloc.py | 9 | ||||
-rw-r--r-- | tests/micropython/heapalloc_super.py | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/micropython/heapalloc.py b/tests/micropython/heapalloc.py index 62f26df6a..f74bb92c8 100644 --- a/tests/micropython/heapalloc.py +++ b/tests/micropython/heapalloc.py @@ -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) diff --git a/tests/micropython/heapalloc_super.py b/tests/micropython/heapalloc_super.py index 1cf5293d2..a8c23393e 100644 --- a/tests/micropython/heapalloc_super.py +++ b/tests/micropython/heapalloc_super.py @@ -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') |