1This directory contains tests for various functionality areas of MicroPython. 2To run all stable tests, run "run-tests.py" script in this directory. 3 4Tests of capabilities not supported on all platforms should be written 5to check for the capability being present. If it is not, the test 6should merely output 'SKIP' followed by the line terminator, and call 7sys.exit() to raise SystemExit, instead of attempting to test the 8missing capability. The testing framework (run-tests.py in this 9directory, test_main.c in qemu_arm) recognizes this as a skipped test. 10 11There are a few features for which this mechanism cannot be used to 12condition a test. The run-tests.py script uses small scripts in the 13feature_check directory to check whether each such feature is present, 14and skips the relevant tests if not. 15 16Tests are generally verified by running the test both in MicroPython and 17in CPython and comparing the outputs. If the output differs the test fails 18and the outputs are saved in a .out and a .exp file respectively. 19For tests that cannot be run in CPython, for example because they use 20the machine module, a .exp file can be provided next to the test's .py 21file. A convenient way to generate that is to run the test, let it fail 22(because CPython cannot run it) and then copy the .out file (but not 23before checking it manually!) 24 25When creating new tests, anything that relies on float support should go in the 26float/ subdirectory. Anything that relies on import x, where x is not a built-in 27module, should go in the import/ subdirectory. 28