This commit renames the NORETURN macro, indicating to the compiler
that a function does not return, into MP_NORETURN to maintain the same
naming convention of other similar macros.
To maintain compaitiblity with existing code NORETURN is aliased to
MP_NORETURN, but it is also deprecated for MicroPython v2.
This changeset was created using a similar process to
decf8e6a8b ("all: Remove the "STATIC"
macro and just use "static" instead."), with no documentation or python
scripts to change to reflect the new macro name.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This is a generic interface to allow querying and modifying the read-only
memory area of a device, if it has such an area.
Signed-off-by: Damien George <damien@micropython.org>
This commit adds the natmod tests for the MPS2_AN385 board running
inside QEMU to the CI pipeline. Now natmod tests capabilities are equal
between the Arm and RV32 platforms for the QEMU port.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit fixes the command used to run natmod tests, as it relied on
a string interpolation feature of the POSIX shell that was not working
as expected inside a makefile.
The interpolation was not performed from inside the makefile and the raw
command string was sent to the operating system for execution. Now the
command is run by using a different type of string substitution, which
explicitly performs the interpolation using a POSIX shell for-loop.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit lets the natmod tests runner to automatically detect the
architecture of the test target. This allows to avoid to explicitly
pass the architecture name to the runner in test scripts.
However, the ability to manually specify a target was not removed but it
was made optional. This way the user is able to override the
architecture name if needed (like if one wants to test an armv6 MPY on
an armv7 board).
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit moves `<board>.mk` to `<board>/mpconfigboard.mk` for all qemu
boards, making it the same as other bare-metal ports.
Signed-off-by: Damien George <damien@micropython.org>
This commit re-introduces `tests/extmod/vfs_rom.py` and
`tests/float/math_domain.py` to the test suite, as the issues that made
them fail have now been addressed.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit increases the GC heap size from 120KiB to 140KiB, as it is
needed to make the full test suite pass on SABRELITE when ran through the
armv6 native emitter.
This is needed as the code output by the armv6 native emitter is limited to
4-bytes opcodes and thus takes more space than other ARM emitters.
To keep things aligned, the RV32 port also got its heap size increased even
though it is not needed on that platform right now.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
The Micro:Bit machine definition in Qemu has soft MMU support enabled,
which is currently not compatible with the way MicroPython generates code
that needs to call back into non-emitted code.
As a stop-gap solution, the native code emitter for the MICROBIT board is
turned off.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
When a CPU exception is raised when emulating a Thumb-capable processor,
the default exception handler would simply enter in an endless loop without
providing any further information.
This commit adds a more complete exception handler that dumps to STDOUT the
exception cause and the status of the registers at the moment of the
exception.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
The tests now include `--via-mpy` and `--via-mpy --emit native`, which will
test more cases of the native emitter under both ARM and RISC-V.
Signed-off-by: Damien George <damien@micropython.org>
The `asmbcc`, `asmbitops`, `asmconst` and `asmit` tests fail to compile
with mpy-cross on armv6 architecture (used by SABRELITE), so explicitly
exclude them.
The `math_domain` and `vfs_rom` tests fail when compiled to native machine
code, so also exclude those unconditionally.
Signed-off-by: Damien George <damien@micropython.org>
This commit implements a method to detect at runtime if inline assembler
support is enabled, and if so which platform it targets.
This allows clean test runs even on modified version of ARM-based ports
where inline assembler support is disabled, running inline assembler tests
on ports that have such feature not enabled by default and manually
enabled, and allows to always run the correct inlineasm tests for ports
that support more than one architecture (esp32, qemu, rp2).
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
In certain circumstances depending on the code size, the
`deflate_decompress` test fails on both ARM and RV32 with a memory
allocation failure error. The issue is mitigated by having a larger GC
heap, in this case around 20 KBytes more than the original 100 KBytes
default.
This commit makes the GC heap size configurable on a per-arch basis, with
both ARM and RV32 using the enlarged 120 KBytes heap.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit adds support for writing inline assembler functions when
targeting a RV32IMC processor.
Given that this takes up a bit of rodata space due to its large
instruction decoding table and its extensive error messages, it is
enabled by default only on offline targets such as mpy-cross and the
qemu port.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
Thumb/Thumb2 tests are now into their own subdirectory, as
RV32IMC-specific tests will be added as part of the RV32 inline
assembler support.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit brings the natmod tests in the CI build process for the RV32
platform. Not all example natmods are tested at the moment, as
`features` requires soft-float support, and `btree` needs thread-local
storage support in `mpy_ld.py` when built with the CI's toolchain.
Co-authored-by: Damien George <damien@micropython.org>
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This allows importing from the VFS, and enables the following 7 additional
tests: builtin_execfile, io_iobase, json_dump_iobase, import_mpy_invalid,
import_mpy_native, import_mpy_native_gc, vfs_userfs.
Signed-off-by: Damien George <damien@micropython.org>
Previously to this commit, running the test suite on a bare-metal board
required specifying the target (really platform) and device, eg:
$ ./run-tests.py --target pyboard --device /dev/ttyACM1
That's quite a lot to type, and you also need to know what the target
platform is, when a lot of the time you either don't care or it doesn't
matter.
This commit makes it easier to run the tests by replacing both of these
options with a single `--test-instance` (`-t` for short) option. That
option specifies the executable/port/device to test. Then the target
platform is automatically detected.
The `--test-instance` can be passed:
- "unix" (the default) to use the unix version of MicroPython
- "webassembly" to test the webassembly port
- anything else is considered a port/device to pass to Pyboard
There are also some shortcuts to specify a port/device, following
`mpremote`:
- a<n> is short for /dev/ttyACM<n>
- u<n> is short for /dev/ttyUSB<n>
- c<n> is short for COM<n>
For example:
$ ./run-tests.py -t a1
Note that the default test instance is "unix" and so this commit does not
change the standard way to run tests on the unix port, by just doing
`./run-tests.py`.
As part of this change, the platform (and it's native architecture if it
supports importing native .mpy files) is show at the start of the test run.
Signed-off-by: Damien George <damien@micropython.org>