Paul Sokolovsky
eb0e3bab1e
tests/machine_mem.py: Too non-portable, rework as an example for unix port.
2016-07-31 04:22:09 +03:00
Paul Sokolovsky
617bda27e9
tests/extmod/btree1: Tests against in-memory DB (using io.BytesIO).
2016-07-31 02:29:05 +03:00
Paul Sokolovsky
abd5a57ea1
tests/io/bytesio_ext: Test for .seek()/.flush() on BytesIO.
2016-07-29 23:00:25 +03:00
Paul Sokolovsky
6ead9f6f3d
tests/run-tests: Make "regex'ed .exp" facility available to device tests.
...
Required to pass bytes_compare3.py (opptional warnings) on devices.
2016-07-26 23:08:33 +03:00
Paul Sokolovsky
d1771bbae0
tests/unicode_subscr.py: Detailed test for subscripting unicode strings.
2016-07-25 19:28:19 +03:00
Paul Sokolovsky
6af90b2972
py/objstrunicode: str_index_to_ptr: Should handle bytes too.
...
There's single str_index_to_ptr() function, called for both bytes and
unicode objects, so should handle each properly.
2016-07-25 14:45:08 +03:00
Paul Sokolovsky
5a38694f55
tests/extmod/btree1: Close database at the end of test.
2016-07-24 00:30:32 +03:00
Paul Sokolovsky
b652ee705b
tests/bytes_compare: Rework test for bytes <-> str comparison.
...
This may produce a warning, depending on MicroPython configuration.
2016-07-22 12:02:04 +03:00
Paul Sokolovsky
c3f519adfe
tests/extmod/machine_pinbase: Skip if machine.PinBase is not available.
2016-07-17 16:30:24 +03:00
Paul Sokolovsky
0b52228739
tests: Add test for extended arguments to stream .write() method.
2016-07-14 11:48:15 +03:00
Damien George
2b5a1067c0
tests/run-tests: If running thread tests on unix, don't run mutate ones.
...
They will fail because the GIL is disabled on the unix build.
2016-07-09 16:52:57 +01:00
Paul Sokolovsky
92a9078a6f
tests/meminfo: Update for addition of "max free sz" output.
2016-07-01 00:39:26 +03:00
Damien George
8b9ddf4031
tests/thread: Allow some tests to run on ports with not much heap.
2016-06-28 11:28:52 +01:00
Damien George
63d05228a3
tests/thread: Allow thread_sleep1 to run without floating point.
2016-06-28 11:28:52 +01:00
Damien George
15e68277c1
tests/thread: Make sure that thread tests don't rely on floating point.
2016-06-28 11:28:52 +01:00
Damien George
5b7789d519
tests/thread: Make stack-size test run correctly and reliable on uPy.
2016-06-28 11:28:52 +01:00
Damien George
b7274e91bc
tests/thread: Add test for concurrent mutating of user instance.
2016-06-28 11:28:50 +01:00
Damien George
2e4cdae4fd
tests/thread: Add test for concurrent interning of strings.
...
Qstr code accesses global state and needs to be made thread safe.
2016-06-28 11:28:50 +01:00
Damien George
094a0dd11a
tests/thread: Add tests that mutate shared objects.
...
Tests concurrent mutating access to: list, dict, set, bytearray.
2016-06-28 11:28:50 +01:00
Damien George
c73cf9d931
tests/thread: Rename thread_stress_XXX.py to stress_XXX.py.
2016-06-28 11:28:50 +01:00
Damien George
dcc7c5bd89
tests/thread: Add tests for running GC within a thread, and heap stress.
2016-06-28 11:28:49 +01:00
Damien George
3545ef8bb4
tests/thread: Remove need to sleep to wait for completion in some tests.
...
Use a lock and a counter instead, and busy wait for all threads to
complete. This makes test run faster and they no longer rely on the time
module.
2016-06-28 11:09:31 +01:00
Damien George
2d5ea38b49
tests: Add 3 more tests for _thread module.
2016-06-28 11:09:31 +01:00
Damien George
ed36632c6c
tests: Add tests for _thread module.
...
Includes functionality and stress tests.
2016-06-28 11:09:31 +01:00
Paul Sokolovsky
0fb7a7a7ce
tests/btree1: Add testcase for iterating btree object directly.
2016-06-24 23:43:20 +03:00
Paul Sokolovsky
d5835261af
tests/extmod: Add "btree" module test.
2016-06-21 10:00:02 +03:00
Paul Sokolovsky
119b3dabf7
tests: Add a testcase for machine.PinBase class.
2016-06-19 19:45:29 +03:00
Mark Anthony Palomer
deaf0712aa
tests: Add testcase for OrderedDict equality.
...
There's a need for .exp file because CPython renders OrderedDict's as:
OrderedDict([('b', 2)])
while MicroPython as:
OrderedDict({'b': 2})
2016-06-12 17:37:19 +03:00
Paul Sokolovsky
e918fc5e37
tests/bench: Add testcase to compare bytes(N) vs b"\0" * N.
...
Based on python-dev discussion regarding PEP467.
2016-06-08 14:28:18 +03:00
Damien George
b1533c4366
py/parse: Treat constants that start with underscore as private.
...
Assignments of the form "_id = const(value)" are treated as private
(following a similar CPython convention) and code is no longer emitted
for the assignment to a global variable.
See issue #2111 .
2016-06-06 17:28:32 +01:00
Paul Sokolovsky
a1a261d8e8
tests/recursive_iternext: Clang/Linux is even more stack-frugal than MacOS.
2016-06-04 21:10:43 +03:00
Damien George
97ce5d1d77
tests/pyb/rtc: Make RTC test on pyboard more reliable by calling init().
2016-06-03 15:13:39 +01:00
Damien George
7d60a97914
tests/misc/recursive_iternext: Provide more fine-grained selection of N.
...
To work on a variety of ports the selection of N is very specific.
2016-06-03 15:09:45 +01:00
Damien George
ddadbaed06
tests/misc/recursive_iternext.py: Increase depth N from 1000 to 2000.
...
This makes the test reliably overflow the recursion limit (which is the
correct behaviour) on Mac OS X.
2016-06-03 09:33:57 +01:00
Paul Sokolovsky
f0eea1fdf9
tests/extmod/vfs_fat_ramdisk: Add testcases for chdir(), getcwd().
2016-05-29 18:54:14 +03:00
Damien George
715ee9d925
py/modstruct: Allow to have "0s" in struct format.
2016-05-28 23:27:38 +01:00
Antonin ENFRUN
ca41dc2750
py/objnamedtuple: Allow passing field names as a tuple.
...
So the documentation's example works. Besides, a tuple can be more
memory efficient.
2016-05-23 21:08:07 +01:00
Paul Sokolovsky
53bac8e869
tests: Add testcase for str.center().
2016-05-22 00:18:53 +03:00
Paul Sokolovsky
719f8c044a
tests/struct1: Add testcase for an unknown type char.
2016-05-14 15:54:09 +03:00
Damien George
1e2f829293
tests/basics/string_splitlines: Reinstate feature test for splitlines.
2016-05-13 13:11:22 +01:00
Damien George
cc80c4dd59
py/objstr: Make dedicated splitlines function, supporting diff newlines.
...
It now supports \n, \r and \r\n as newline separators.
Adds 56 bytes to stmhal and 80 bytes to unix x86-64.
Fixes issue #1689 .
2016-05-13 12:21:32 +01:00
Damien George
5ab98d5c41
stmhal: Convert to use internal errno symbols; enable uerrno module.
2016-05-10 23:30:39 +01:00
Damien George
65402ab1ec
py/mpz: Do Python style division/modulo within bignum divmod routine.
...
This patch consolidates the Python logic for division/modulo to one place
within the bignum code.
2016-05-08 22:21:21 +01:00
Damien George
dc3faea040
py/mpz: Fix bug with overflowing C-shift in division routine.
...
When DIG_SIZE=32, a uint32_t is used to store limbs, and no normalisation
is needed because the MSB is already set, then there will be left and
right shifts (in C) by 32 of a 32-bit variable, leading to undefined
behaviour. This patch fixes this bug.
2016-05-08 21:38:43 +01:00
Henrik Sölver
c4587e2426
stmhal/can: Allow to get existing CAN obj if constructed without args.
...
Initialisation of CAN objects should now behave as other peripheral
objects.
Fixes issue #2001 .
2016-05-08 12:47:33 +01:00
Damien George
9e47c145c7
tests: Disable memoryview tests that overflow int conversion.
...
They fail on builds with 32-bit word size.
2016-05-07 22:36:49 +01:00
Damien George
470c429ee1
py/runtime: Properly handle passing user mappings to ** keyword args.
2016-05-07 22:02:46 +01:00
Damien George
12dd8df375
py/objstr: Binary type of str/bytes for buffer protocol is 'B'.
...
The type is an unsigned 8-bit value, since bytes objects are exactly
that. And it's also sensible for unicode strings to return unsigned
values when accessed in a byte-wise manner (CPython does not allow this).
2016-05-07 21:18:17 +01:00
Paul Sokolovsky
5ec11f565b
tests/run-tests: Factor out list supported external boards.
...
To get consistent error messages, etc.
2016-05-07 18:45:16 +03:00
Paul Sokolovsky
566d8f1d7e
tests: Make "io" modules fixes for CPython compatibility.
...
Previously, "import _io" worked on both CPython and MicroPython (essentially
by a chance on CPython, as there's not guarantee that its contents will stay
the same across versions), but as the module was renamed to uio, need to use
more robust import sequence for compatibility.
2016-05-02 14:38:07 +03:00