summaryrefslogtreecommitdiff
path: root/tests/micropython/import_mpy_native_gc.py
diff options
context:
space:
mode:
authorAlessandro Gatti <a.gatti@frob.it>2025-09-24 22:26:39 +0200
committerAlessandro Gatti <a.gatti@frob.it>2025-10-24 19:13:15 +0200
commit430837996b3cbb85849be92cc4d9ce98ce2a0905 (patch)
treec4415e18addffddd03e774cfb914e651b9beb7e1 /tests/micropython/import_mpy_native_gc.py
parent3e2b41f8f60d39226320aad93ed3490d5add1799 (diff)
py/modsys: Add architecture flags to MicroPython metadata.
This commit adds the currently supported architecture flags value as the upper part of "sys.implementation._mpy". This had the side effect of perturbing quite a bit of testing infrastructure and invalidating documentation related to MPY files. To make the test suite run successfully and keep the documentation in sync the following changes have been made: * The target info feature check file now isolates eventual architecture flags and adds them as a separate field * The test runner now picks up the new architecture flags field, reports it to STDOUT if needed and stores it for future uses * Relevant test files for MPY files import code had to be updated to mask out the architecture flags bits in order to perform correctly * MPY file format documentation was updated to show how to mask off and properly display the architecture flags information. This works out of the box if the flag bits can fit in a smallint value once merged with the MPY file header value. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
Diffstat (limited to 'tests/micropython/import_mpy_native_gc.py')
-rw-r--r--tests/micropython/import_mpy_native_gc.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/micropython/import_mpy_native_gc.py b/tests/micropython/import_mpy_native_gc.py
index 851eb3922..997e052fd 100644
--- a/tests/micropython/import_mpy_native_gc.py
+++ b/tests/micropython/import_mpy_native_gc.py
@@ -67,7 +67,7 @@ for arch in (0x1406, 0x1806, 0x1C06, 0x2006):
features0_file_contents[arch] = features0_file_contents[0x1006]
# Check that a .mpy exists for the target (ignore sub-version in lookup).
-sys_implementation_mpy = sys.implementation._mpy & ~(3 << 8)
+sys_implementation_mpy = (sys.implementation._mpy & ~(3 << 8)) & 0xFFFF
if sys_implementation_mpy not in features0_file_contents:
print("SKIP")
raise SystemExit