circuitpython/tests
Jeff Epler aca9d5bc40 Fix up all natmod examples
* modframebuf: _mp_framebuf_p_t is not "really" a protocol, but the
   QSTR assignment caused problems when building as a dynamic module
 * modure: str_index_to_ptr is not in the natmod API, disable URE match
   spans when dynamic.  mp_obj_len() is a bugfix, we should throw here
   if the object is not string-like
 * moduzlib: Correct paths to uzlib headers & sources.  this relative
   path (from moduzlib.c to the referenced file) works in all cases,
   the other only worked from ports/PORTNAME.
 * dynruntime: Handle 2-arg m_malloc, assert_native_inited, add a
   micropythonish mp_arg_check_num_mp, fix mp_raise_msg to use dumb
   strings, add mp_raise_arg1
 * nativeglue: ad assert_native_inited
 * translate: MP_ERROR_TEXT evaluates to its argument for DYNRUNTIME
 * mpy-tool: A straggling magic number change
 * mpy_ld: Have to renumber manually after dynruntime change
 * import_mpy_native_gc.py: Update copy of features0 baked into this test
2021-05-08 20:17:16 -05:00
..
basics tests: Restore memoryview1 test to micropython version 2021-05-05 08:46:37 -05:00
circuitpython run code formatting script 2021-03-15 19:27:36 +05:30
circuitpython-manual [synthio] add a simple MidiTrack implementation 2021-03-26 16:38:10 -04:00
cmdline Merge MicroPython 1.13 into CircuitPython 2021-05-04 18:06:33 -07:00
cpydiff Merge MicroPython 1.13 into CircuitPython 2021-05-04 18:06:33 -07:00
extmod Fixes from review 2021-05-07 09:31:59 -07:00
feature_check Merge MicroPython 1.12 into CircuitPython 2021-05-03 14:01:18 -07:00
float Merge MicroPython 1.13 into CircuitPython 2021-05-04 18:06:33 -07:00
import Merge remote-tracking branch 'adafruit/main' into merge_1.13 2021-05-06 11:17:53 -07:00
inlineasm Merge MicroPython 1.12 into CircuitPython 2021-05-03 14:01:18 -07:00
internal_bench Merge MicroPython 1.12 into CircuitPython 2021-05-03 14:01:18 -07:00
io codeformat 2021-04-19 22:22:44 -07:00
jni run code formatting script 2021-03-15 19:27:36 +05:30
micropython Fix up all natmod examples 2021-05-08 20:17:16 -05:00
misc Merge MicroPython 1.13 into CircuitPython 2021-05-04 18:06:33 -07:00
perf_bench Merge MicroPython 1.12 into CircuitPython 2021-05-03 14:01:18 -07:00
pybnative run code formatting script 2021-03-15 19:27:36 +05:30
qemu-arm Merge MicroPython 1.12 into CircuitPython 2021-05-03 14:01:18 -07:00
stress Merge MicroPython 1.12 into CircuitPython 2021-05-03 14:01:18 -07:00
thread Merge MicroPython 1.13 into CircuitPython 2021-05-04 18:06:33 -07:00
unicode tests: Format all Python code with black, except tests in basics subdir. 2020-03-30 13:21:58 +11:00
unix Merge MicroPython 1.13 into CircuitPython 2021-05-04 18:06:33 -07:00
README tests: Make run-tests help and README be more descriptive of behaviour. 2020-01-22 16:35:24 +11:00
pyboard.py tests: Remove pyboard.py symlink and instead import from ../tools. 2018-09-05 15:36:33 +10:00
run-internalbench.py Merge MicroPython 1.12 into CircuitPython 2021-05-03 14:01:18 -07:00
run-multitests.py tests/run-multitests.py: Allow passing unique env vars to each instance. 2020-06-10 22:41:57 +10:00
run-natmodtests.py Merge MicroPython 1.12 into CircuitPython 2021-05-03 14:01:18 -07:00
run-perfbench.py Merge MicroPython 1.12 into CircuitPython 2021-05-03 14:01:18 -07:00
run-tests Turn off CPython warnings in tests 2021-05-05 17:26:39 -07:00
run-tests-exp.py run code formatting script 2021-03-15 19:27:36 +05:30
run-tests-exp.sh
skip_if.py run code formatting script 2021-03-15 19:27:36 +05:30

README

This directory contains tests for various functionality areas of MicroPython.
To run all stable tests, run "run-tests" 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 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 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.