diff options
| author | Damien George <damien@micropython.org> | 2022-05-26 12:24:46 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-05-26 12:54:43 +1000 |
| commit | 80a86c48e33afc4d1f964c407f0441161eeed71d (patch) | |
| tree | 59856f4e0ad28e8e8d6b91a7b0ee1c1b7ee58272 /tests | |
| parent | 3180113aefb024fe10aa5afd952ecea4d15035ed (diff) | |
tests/micropython: Make import_mpy_native test run on all architectures.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/micropython/import_mpy_native.py (renamed from tests/micropython/import_mpy_native_x64.py) | 17 | ||||
| -rw-r--r-- | tests/micropython/import_mpy_native.py.exp (renamed from tests/micropython/import_mpy_native_x64.py.exp) | 0 |
2 files changed, 8 insertions, 9 deletions
diff --git a/tests/micropython/import_mpy_native_x64.py b/tests/micropython/import_mpy_native.py index 453d81f25..d7da16581 100644 --- a/tests/micropython/import_mpy_native_x64.py +++ b/tests/micropython/import_mpy_native.py @@ -1,15 +1,17 @@ -# 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\x00\x10', + '/mod0.mpy': b'M\x06\xfc\x1f', # 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 diff --git a/tests/micropython/import_mpy_native_x64.py.exp b/tests/micropython/import_mpy_native.py.exp index 320cac09d..320cac09d 100644 --- a/tests/micropython/import_mpy_native_x64.py.exp +++ b/tests/micropython/import_mpy_native.py.exp |
