micropython/tests/feature_check
Damien George 8978102f35 tests/run-tests.py: Change --target/--device options to --test-instance.
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>
2024-11-04 12:47:47 +11:00
..
async_check.py
async_check.py.exp
bytearray.py
bytearray.py.exp
byteorder.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
byteorder.py.exp
complex.py
complex.py.exp
const.py
const.py.exp
coverage.py
coverage.py.exp
float.py
float.py.exp
fstring.py py: Implement partial PEP-498 (f-string) support. 2021-08-14 16:58:40 +10:00
fstring.py.exp py: Implement partial PEP-498 (f-string) support. 2021-08-14 16:58:40 +10:00
inlineasm_thumb2.py tests/run-tests.py: Skip Thumb2 tests if target doesn't support them. 2023-12-06 16:05:37 +11:00
inlineasm_thumb2.py.exp tests/run-tests.py: Skip Thumb2 tests if target doesn't support them. 2023-12-06 16:05:37 +11:00
int_big.py
int_big.py.exp
io_module.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
io_module.py.exp tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
native_check.py
native_check.py.exp
README all: Fix spelling mistakes based on codespell check. 2023-04-27 18:03:06 +10:00
repl_emacs_check.py
repl_emacs_check.py.exp
repl_words_move_check.py
repl_words_move_check.py.exp
reverse_ops.py
reverse_ops.py.exp
set_check.py
set_check.py.exp
slice.py
slice.py.exp
target_info.py tests/run-tests.py: Change --target/--device options to --test-instance. 2024-11-04 12:47:47 +11:00
target_info.py.exp tests/run-tests.py: Automatically detect native arch and mpy-cross flag. 2024-09-04 16:34:01 +10:00

This directory doesn't contain real tests, but code snippets to detect
various interpreter features, which can't be/inconvenient to detect by
other means. Scripts here are executed by run-tests.py at the beginning of
testsuite to decide what other test groups to run/exclude.