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
80a86c48
Commit
80a86c48
authored
May 26, 2022
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests/micropython: Make import_mpy_native test run on all architectures.
Signed-off-by:
Damien George
<
damien@micropython.org
>
parent
3180113a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
tests/micropython/import_mpy_native.py
tests/micropython/import_mpy_native.py
+8
-9
tests/micropython/import_mpy_native.py.exp
tests/micropython/import_mpy_native.py.exp
+0
-0
No files found.
tests/micropython/import_mpy_native
_x64
.py
→
tests/micropython/import_mpy_native.py
View file @
80a86c48
# test importing of .mpy files with native code
(x64 only)
# test importing of .mpy files with native code
try
:
import
usys
,
uio
,
uos
usys
.
implementation
.
_mpy
uio
.
IOBase
uos
.
mount
except
(
ImportError
,
AttributeError
):
print
(
"SKIP"
)
raise
SystemExit
if
not
(
usys
.
platform
==
"linux"
and
usys
.
maxsize
>
2
**
32
):
mpy_arch
=
usys
.
implementation
.
_mpy
>>
8
if
mpy_arch
==
0
:
print
(
"SKIP"
)
raise
SystemExit
...
...
@@ -49,15 +51,14 @@ class UserFS:
# these are the test .mpy files
valid_header
=
bytes
([
77
,
6
,
mpy_arch
,
31
])
# fmt: off
user_files
=
{
# bad architecture
'/mod0.mpy'
:
b'M
\x06\xfc\x
00\x10
'
,
'/mod0.mpy'
:
b'M
\x06\xfc\x
1f
'
,
# test loading of viper and asm
'/mod1.mpy'
:
(
b'M
\x06\x08\x1f
'
# header
'/mod1.mpy'
:
valid_header
+
(
b'
\x02
'
# n_qstr
b'
\x00
'
# n_obj
...
...
@@ -84,9 +85,7 @@ user_files = {
),
# test loading viper with additional scope flags and relocation
'/mod2.mpy'
:
(
b'M
\x06\x08\x1f
'
# header
'/mod2.mpy'
:
valid_header
+
(
b'
\x02
'
# n_qstr
b'
\x00
'
# n_obj
...
...
tests/micropython/import_mpy_native
_x64
.py.exp
→
tests/micropython/import_mpy_native.py.exp
View file @
80a86c48
File moved
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