Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
182256dc
Commit
182256dc
authored
Jun 08, 2022
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests/stress: Adjust bytecode_limit test so it can SKIP if no memory.
Signed-off-by:
Damien George
<
damien@micropython.org
>
parent
c7271a86
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
tests/stress/bytecode_limit.py
tests/stress/bytecode_limit.py
+10
-7
tests/stress/bytecode_limit.py.exp
tests/stress/bytecode_limit.py.exp
+1
-1
No files found.
tests/stress/bytecode_limit.py
View file @
182256dc
...
...
@@ -2,6 +2,16 @@
body
=
" with f()()() as a:
\n
try:
\n
f()()()
\n
except Exception:
\n
pass
\n
"
# Test overflow of jump offset.
for
n
in
(
430
,
431
,
432
,
433
):
try
:
exec
(
"cond = 0
\n
if cond:
\n
"
+
body
*
n
+
"else:
\n
print('cond false')
\n
"
)
except
MemoryError
:
print
(
"SKIP"
)
raise
SystemExit
except
RuntimeError
:
print
(
"RuntimeError"
)
# Test changing size of code info (source line/bytecode mapping) due to changing
# bytecode size in the final passes. This test is very specific to how the
# code info is encoded, and how jump offsets shrink in the final passes. This
...
...
@@ -24,10 +34,3 @@ x = [1 if x else 123]
print(x)
"""
)
# Test overflow of jump offset.
for
n
in
(
430
,
431
,
432
,
433
):
try
:
exec
(
"cond = 0
\n
if cond:
\n
"
+
body
*
n
+
"else:
\n
print('cond false')
\n
"
)
except
RuntimeError
:
print
(
"RuntimeError"
)
tests/stress/bytecode_limit.py.exp
View file @
182256dc
[123]
cond false
cond false
RuntimeError
RuntimeError
[123]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment