summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-04-05 02:33:48 +1000
committerDamien George <damien.p.george@gmail.com>2018-04-05 02:33:48 +1000
commit4caadc3c013a24af8eaaad846a8eca931cd5653e (patch)
treeead07c25fd136054316ee76ee25ad6c800778798
parentf1df86a0177c77769d73bc477570580b4f705acf (diff)
tests/micropython/extreme_exc.py: Fix test to run on more ports/configs.
-rw-r--r--tests/micropython/extreme_exc.py12
-rw-r--r--tests/micropython/extreme_exc.py.exp2
2 files changed, 12 insertions, 2 deletions
diff --git a/tests/micropython/extreme_exc.py b/tests/micropython/extreme_exc.py
index c180f7cc1..86c5fed19 100644
--- a/tests/micropython/extreme_exc.py
+++ b/tests/micropython/extreme_exc.py
@@ -2,6 +2,15 @@
import micropython
+# Check for stackless build, which can't call functions without
+# allocating a frame on the heap.
+try:
+ def stackless(): pass
+ micropython.heap_lock(); stackless(); micropython.heap_unlock()
+except RuntimeError:
+ print("SKIP")
+ raise SystemExit
+
# some ports need to allocate heap for the emergency exception
try:
micropython.alloc_emergency_exception_buf(256)
@@ -40,8 +49,9 @@ def main():
f(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz=1)
except Exception as er:
e = er
+ lst[0] = None
lst = None
- print(repr(e))
+ print(repr(e)[:43])
# raise a deep exception with the heap locked
# should use emergency exception and be unable to resize traceback array
diff --git a/tests/micropython/extreme_exc.py.exp b/tests/micropython/extreme_exc.py.exp
index d7d65e03f..33f942cbc 100644
--- a/tests/micropython/extreme_exc.py.exp
+++ b/tests/micropython/extreme_exc.py.exp
@@ -1,5 +1,5 @@
Exception()
TypeError("unexpected keyword argument 'abcdefghij
-TypeError("unexpected keyword argument 'abc",)
+TypeError("unexpected keyword argument 'abc
RuntimeError('maximum recursion depth exceeded',)
Exception('my exception',)