micropython/tests
Jim Mussared 4e39ff221a py/runtime: Fix bool unary op for subclasses of native types.
Previously a subclass of a type that didn't implement unary_op, or didn't
handle MP_UNARY_OP_BOOL, would raise TypeError on bool conversion.

Fixes #5677.
2021-07-23 12:40:00 +10:00
..
basics py/runtime: Fix bool unary op for subclasses of native types. 2021-07-23 12:40:00 +10:00
cmdline
cpydiff tests/cpydiff/modules_struct_whitespace_in_format: Run black. 2021-07-06 18:19:55 -05:00
esp32
extmod tests/extmod: Make uasyncio_heaplock test more deterministic. 2021-06-25 11:31:00 +10:00
feature_check tests/feature_check: Check for lack of pass result rather than failure. 2021-04-15 00:52:56 +10:00
float tests/float: Make bytes/bytearray construct tests work with obj repr C. 2021-06-18 14:16:07 +10:00
import py/builtinimport: Change relative import's ValueError to ImportError. 2021-05-30 19:35:03 +10:00
inlineasm
internal_bench
io
jni
micropython py/emitnative: Ensure stack settling is safe mid-branch. 2021-07-19 23:18:59 +10:00
misc
multi_bluetooth tests/multi_bluetooth/ble_gap_advertise.py: Allow to work without set. 2021-06-06 21:58:07 +10:00
multi_net extmod/uasyncio: Add readinto() method to Stream class. 2021-06-15 13:13:35 +10:00
net_hosted extmod/uasyncio: Get addr and bind server socket before creating task. 2021-06-26 22:30:22 +10:00
net_inet tests: Use .errno instead of .args[0] for OSError exceptions. 2021-04-23 22:03:46 +10:00
perf_bench
pyb stm32: Replace master/slave with controller/peripheral in I2C and SPI. 2021-07-18 11:23:41 +10:00
pybnative
qemu-arm
stress
thread tests/thread: Make exc1,exit1,exit2,stacksize1,start1 tests run on rp2. 2021-05-10 13:07:16 +10:00
unicode
unix tests/unix: Add ffi test for integer types. 2021-06-06 22:52:25 +10:00
wipy
README
run-internalbench.py
run-multitests.py tests/run-multitests.py: Allow to work without sys.stdout on target. 2021-06-06 21:58:07 +10:00
run-natmodtests.py
run-perfbench.py tests/run-perfbench.py: Fix native feature check. 2021-05-11 23:45:36 +10:00
run-tests-exp.py
run-tests-exp.sh
run-tests.py tests/run-tests.py: Parallelize running tests by default. 2021-05-14 11:33:31 +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.