aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2017-03-07tests/string_format_modulo2: Split off intbig test.Paul Sokolovsky
2017-03-06tests/float2int*: Suffix with _intbig, don't run on any other int type.Paul Sokolovsky
I.e. they don't run successfully with MICROPY_LONGINT_IMPL_NONE and MICROPY_LONGINT_IMPL_LONGLONG (the problem is that they generate different output than CPython, TODO to fix that).
2017-03-06float/float2int*: Make actually be parsable for MICROPY_LONGINT_IMPL_NONE.Paul Sokolovsky
The use of large literal numbers is a big no-no when it comes to writing programs which work with different int representations. Also, some checks are pretty adhoc (e.g using struct module to check for 64-bitness). This change bases entire detection on sys.maxsize and integer operarions, and thus more correct, even if longer. Note that this change doesn't mean that any of these tests can pass with anything but MPZ - even despite checking for various int representations, the tests aren't written to be portable among them.
2017-03-06tests/float/complex1: Split out intbig test.Paul Sokolovsky
2017-03-04tests/basic: Split tests into working with small ints and not working.Paul Sokolovsky
Tests which don't work with small ints are suffixed with _intbig.py. Some of these may still work with long long ints and need to be reclassified later.
2017-03-03tests/run-tests: Check for big int availability and skip related tests.Paul Sokolovsky
Big aka arbitrary-precision integers (implemented by MPZ module) are used in tests starting with "int_big_" or ending with "_intbig".
2017-03-03tests/basics: Add further tests for OrderedDict.Damien George
2017-03-02tests/extmod: Add test for machine.Signal class.Damien George
2017-02-27py/objarray: Disallow slice-assignment to read-only memoryview.Damien George
Also comes with a test for this. Fixes issue #2904.
2017-02-24py: Create str/bytes objects in the parser, not the compiler.Damien George
Previous to this patch any non-interned str/bytes objects would create a special parse node that held a copy of the str/bytes data. Then in the compiler this data would be turned into a str/bytes object. This actually lead to 2 copies of the data, one in the parse node and one in the object. The parse node's copy of the data would be freed at the end of the compile stage but nevertheless it meant that the peak memory usage of the parse/compile stage was higher than it needed to be (by an amount equal to the number of bytes in all the non-interned str/bytes objects). This patch changes the behaviour so that str/bytes objects are created directly in the parser and the object stored in a const-object parse node (which already exists for bignum, float and complex const objects). This reduces peak RAM usage of the parse/compile stage, simplifies the parser and compiler, and reduces code size by about 170 bytes on Thumb2 archs, and by about 300 bytes on Xtensa archs.
2017-02-24tests/micropython: Add test for consts that are bignums.Damien George
2017-02-20tests/cpydiff: Add a test for storing iterable to a list slice.Damien George
2017-02-20tests/cpydiff: Add initial set of tests for uPy-CPython differences.Rami Ali
These tests are intended to fail, as they provide a programatic record of differences between uPy and CPython. They also contain a special comment at the start of the file which has meta-data describing the difference, including known causes and known workarounds.
2017-02-20py/objlist: For list slice assignment, allow RHS to be a tuple or list.Damien George
Before this patch, assigning anything other than a list would lead to a crash. Fixes issue #2886.
2017-02-20tests/heapalloc_exc_raise.py: Heap alloc test for raising/catching exc.Paul Sokolovsky
2017-02-17tests/basics/string_join: Add more tests for string concatenation.Damien George
2017-02-17tests/cmdline/cmd_parsetree: Update to work with changes to grammar.Damien George
2017-02-16tests/cmdline: Update cmd_parsetree test for changes to grammar order.Damien George
2017-02-16tests/micropython/heapalloc_iter: Add tests for contains and unpack.Damien George
2017-02-16tests/micropython: Add test for iterating with the heap locked.Damien George
2017-02-16tests/cmdline/cmd_showbc: Update to work with recent changes.Damien George
2017-02-16tests/cmdline: Update tests to pass with latest changes to bytecode.Damien George
2017-02-16py: Allow bytecode/native to put iter_buf on stack for simple for loops.Damien George
So that the "for x in it: ..." statement can now work without using the heap (so long as the iterator argument fits in an iter_buf structure).
2017-02-15tests/basic/: Make various tests skippable.Paul Sokolovsky
To run the testsuite on small ports.
2017-02-15tests/gen_yield_from_close: Use range() instead of reversed().Paul Sokolovsky
As a "more basic" builtin iterator, present even in smaller ports.
2017-02-15tests/thread: Add stress-test for creating many threads.Damien George
2017-02-15tests/thread: Replace busy waiting loops with a loop that sleeps.Damien George
Depending on the thread scheduler, a busy-wait loop can hog the CPU and make the tests very slow. So convert such loops to loops that have an explicit sleep, allowing the worker threads to do their job.
2017-02-15tests/extmod: Make tests skippable.Paul Sokolovsky
2017-02-15tests/dict_fromkeys: Revert to use reversed() to run in native codegen mode.Paul Sokolovsky
2017-02-15tests/basic/[a-f]*: Make skippable.Paul Sokolovsky
For small ports which don't have all features enabled.
2017-02-14tests/builtin_dir: The most expected thing in sys is exit, test for it.Paul Sokolovsky
2017-02-14tests/comprehension1, containment: Split set tests to separate files.Paul Sokolovsky
To make skippable.
2017-02-14tests/run-tests: Allow to skip tests using async/await keywords.Paul Sokolovsky
2017-02-14tests: Add option to not clear MICROPYPATH when running testsstijn
This allows using the test runner for other scenarios than just testing uPy itself. The principle of comparing either to CPython or else to a .exp file is really handy but to be able to test custom modules not built into micropython.exe one needs to be able to specify the module search path a.k.a MICROPYPATH.
2017-02-10tests/misc: Add test for line number printing with large bytecode chunk.Damien George
2017-02-09py/objtype: Implement __delattr__ and __setattr__.dmazzella
This patch implements support for class methods __delattr__ and __setattr__ for customising attribute access. It is controlled by the config option MICROPY_PY_DELATTR_SETATTR and is disabled by default.
2017-02-06tests/pyb: Adjust tests so they can run on PYB and PYBLITE.Damien George
A few tests still fail on PYBLITE, and that's due to differences in the available peripheral block numbers on the different MCUs (eg I2C(2) exists on one, but it's I2C(3) on the other).
2017-02-06stmhal: Add pyb.fault_debug() function, to control hard-fault behaviour.Damien George
This new function controls what happens on a hard-fault: - debugging disabled: board will do a reset - debugging enabled: board will print registers and stack and flash LEDs The default is disabled, ie to do a reset. This is different to previous behaviour which flashed the LEDs and waited indefinitely.
2017-02-05extmod/machine_pulse: Make time_pulse_us() not throw exceptions.Paul Sokolovsky
machine.time_pulse_us() is intended to provide very fine timing, including while working with signal bursts, where each transition is tracked in row. Throwing and handling an exception may take too much time and "signal loss". So instead, in case of a timeout, just return negative value. Cases of timeout while waiting for initial signal stabilization, and during actual timing, are recognized. The documentation is updated accordingly, and rewritten somewhat to clarify the function behavior.
2017-02-03tests/basics/string_format_modulo: Add more tests for dict formatting.Damien George
2017-02-02tests: Split tests for 2- and 3-arg pow().Paul Sokolovsky
2017-02-02py: Added optimised support for 3-argument calls to builtin.pow()Nicko van Someren
Updated modbuiltin.c to add conditional support for 3-arg calls to pow() using MICROPY_PY_BUILTINS_POW3 config parameter. Added support in objint_mpz.c for for optimised implementation.
2017-02-03tests/float: Add tests for zero to a negative power.Damien George
2017-02-02tests/basics/set_binop: Add tests for inplace set operations.Damien George
2017-02-02tests/heapalloc_bytesio: Test for BytesIO with preallocates space.Paul Sokolovsky
2017-02-01tests/thread: Fix stack size test so tests run reliably on baremetal.Damien George
2017-01-31tests/thread: Make thread_exc2 runable on baremetal.Damien George
2017-01-31tests/basics/zip: Make skippable.Paul Sokolovsky
2017-01-31tests/run-tests: Skip frozenset tests if set literal syntax is not available.Paul Sokolovsky
2017-01-27tests/extmod/vfs_fat_ramdisk: Make it work on pyboard.Damien George