micropython/tests
Damien George bb00125aaa py: Support single argument to optimised MP_OBJ_STOP_ITERATION.
The MP_OBJ_STOP_ITERATION optimisation is a shortcut for creating a
StopIteration() exception object, and means that heap memory does not need
to be allocated for the exception (in cases where it can be used).  This
commit allows this optimised object to take an optional argument (before,
it could only have no argument).

The commit also adds some new tests to cover corner cases with
StopIteration and generators that previously did not work.

Signed-off-by: Damien George <damien@micropython.org>
2021-07-15 00:12:41 +10:00
..
basics py: Support single argument to optimised MP_OBJ_STOP_ITERATION. 2021-07-15 00:12:41 +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
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
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
perf_bench
pyb
pybnative
qemu-arm
stress
thread
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
run-tests-exp.py
run-tests-exp.sh
run-tests.py

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.