micropython/tests
Christopher Swenson 8c656754aa py/modmath: Add math.factorial, optimised and non-opt implementations.
This commit adds the math.factorial function in two variants:
- squared difference, which is faster than the naive version, relatively
  compact, and non-recursive;
- a mildly optimised recursive version, faster than the above one.

There are some more optimisations that could be done, but they tend to take
more code, and more storage space.  The recursive version seems like a
sensible compromise.

The new function is disabled by default, and uses the non-optimised version
by default if it is enabled.  The options are MICROPY_PY_MATH_FACTORIAL
and MICROPY_OPT_MATH_FACTORIAL.
2018-09-26 15:03:04 +10:00
..
basics py/objgenerator: Implement PEP479, StopIteration convs to RuntimeError. 2018-09-20 15:36:59 +10:00
bench
cmdline
cpydiff
extmod tests/extmod/uhashlib_md5: Add coverage tests for MD5 algorithm. 2018-09-11 14:52:00 +10:00
feature_check
float py/modmath: Add math.factorial, optimised and non-opt implementations. 2018-09-26 15:03:04 +10:00
import
inlineasm
io tests: Move non-filesystem io tests to basics dir with io_ prefix. 2018-06-27 16:55:05 +10:00
jni
micropython py: Shorten error messages by using contractions and some rewording. 2018-09-20 14:33:10 +10:00
misc py: Shorten error messages by using contractions and some rewording. 2018-09-20 14:33:10 +10:00
net_hosted
net_inet
pyb
pybnative
stress
thread
unicode
unix
wipy
README
run-bench-tests
run-tests py/objgenerator: Implement PEP479, StopIteration convs to RuntimeError. 2018-09-20 15:36:59 +10:00
run-tests-exp.py
run-tests-exp.sh

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.

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.