micropython/tests
jc_.kim 19f09414a6 tests/micropython/const.py: Add comment about required config for test.
Expected result of const.py will be matched only when MICROPY_COMP_CONST is
enabled.  For easy understanding, added description at the first of the
test code.
2021-11-17 14:28:20 +11:00
..
basics tests/basics: Add tests for type-checking subclassed exc instances. 2021-10-21 12:42:48 +11:00
cmdline all: Remove MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE. 2021-09-16 16:04:03 +10:00
cpydiff
esp32
extmod extmod/uasyncio: Fix gather returning exceptions from a cancelled task. 2021-11-17 14:11:31 +11:00
feature_check
float
import
inlineasm
internal_bench
io
jni
micropython tests/micropython/const.py: Add comment about required config for test. 2021-11-17 14:28:20 +11:00
misc
multi_bluetooth tests/multi_bluetooth/ble_subscribe.py: Add test for subscription. 2021-08-14 22:44:47 +10:00
multi_net
net_hosted
net_inet
perf_bench tests/perf_bench: Use math.log instead of math.log2. 2021-09-13 18:27:39 +10:00
pyb
pybnative tests/pybnative: Make while.py test run on boards without pyb.delay. 2021-09-01 00:43:41 +10:00
qemu-arm
stress
thread
unicode
unix
wipy
README
run-internalbench.py
run-multitests.py
run-natmodtests.py
run-perfbench.py
run-tests-exp.py
run-tests-exp.sh
run-tests.py all: Remove MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE. 2021-09-16 16:04:03 +10:00

README

This directory contains tests for various functionality areas of MicroPython.
To run all stable tests, run "run-tests.py" script in this directory.

Tests of capabilities not supported on all platforms should be written
to check for the capability being present. If it is not, the test
should merely output 'SKIP' followed by the line terminator, and call
sys.exit() to raise SystemExit, instead of attempting to test the
missing capability. The testing framework (run-tests.py in this
directory, test_main.c in qemu_arm) recognizes this as a skipped test.

There are a few features for which this mechanism cannot be used to
condition a test. The run-tests.py script uses small scripts in the
feature_check directory to check whether each such feature is present,
and skips the relevant tests if not.

Tests are generally verified by running the test both in MicroPython and
in CPython and comparing the outputs. If the output differs the test fails
and the outputs are saved in a .out and a .exp file respectively.
For tests that cannot be run in CPython, for example because they use
the machine module, a .exp file can be provided next to the test's .py
file. A convenient way to generate that is to run the test, let it fail
(because CPython cannot run it) and then copy the .out file (but not
before checking it manually!)

When creating new tests, anything that relies on float support should go in the
float/ subdirectory.  Anything that relies on import x, where x is not a built-in
module, should go in the import/ subdirectory.