micropython/tests
Damien George a506335524 py/emit: Suppress unreachable bytecode/native code that follows jump.
This new logic tracks when an unconditional jump/raise occurs in the
emitted code stream (bytecode or native machine code) and suppresses all
subsequent code, until a label is assigned.  This eliminates a lot of
cases of dead code, with relatively simple logic.

This commit combined with the previous one (that removed the existing
dead-code finding logic) has the following code size change:

       bare-arm:   -16 -0.028%
    minimal x86:   -60 -0.036%
       unix x64:  -368 -0.070%
    unix nanbox:   -80 -0.017%
          stm32:  -204 -0.052% PYBV10
         cc3200:    +0 +0.000%
        esp8266:  -232 -0.033% GENERIC
          esp32:  -224 -0.015% GENERIC[incl -40(data)]
         mimxrt:  -192 -0.054% TEENSY40
     renesas-ra:  -200 -0.032% RA6M2_EK
            nrf:   +28 +0.015% pca10040
            rp2:  -256 -0.050% PICO
           samd:   -12 -0.009% ADAFRUIT_ITSYBITSY_M4_EXPRESS

Signed-off-by: Damien George <damien@micropython.org>
2022-06-20 22:28:18 +10:00
..
basics tests/basics: Add .exp file for sys.tracebacklimit test. 2022-06-07 16:55:18 +10:00
cmdline py/emit: Suppress unreachable bytecode/native code that follows jump. 2022-06-20 22:28:18 +10:00
cpydiff
esp32
extmod extmod/uasyncio: Fix edge case for cancellation of wait_for. 2022-06-02 17:14:20 +10:00
feature_check
float
import
inlineasm
internal_bench
io
jni
micropython py/persistentcode: Remove remaining native qstr linking support. 2022-06-07 13:19:55 +10:00
misc
multi_bluetooth
multi_net
net_hosted
net_inet tests/net_inet: Remove broken api.telegram.org from tests. 2022-06-03 14:34:29 +10:00
perf_bench
pyb
qemu-arm
renesas-ra test/renesas-ra: Remove unsupported feature test of Pin. 2022-06-03 10:58:16 +10:00
stress tests/stress: Adjust bytecode_limit test so it can SKIP if no memory. 2022-06-08 15:00:59 +10:00
thread
unicode
unix
wipy
README
run-internalbench.py
run-multitests.py tests/run-multitests.py: Read IP address from boot nic if available. 2022-06-03 14:35:37 +10:00
run-natmodtests.py
run-perfbench.py
run-tests-exp.py
run-tests-exp.sh
run-tests.py tests: Move native while test from pybnative to micropython. 2022-05-26 12:54:43 +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.