Commit Graph

1326 Commits

Author SHA1 Message Date
Scott Shawcroft 30ee7019ca Merge tag 'v1.9.1'
Fixes for stmhal USB mass storage, lwIP bindings and VFS regressions

This release provides an important fix for the USB mass storage device in
the stmhal port by implementing the SCSI SYNCHRONIZE_CACHE command, which
is now require by some Operating Systems.  There are also fixes for the
lwIP bindings to improve non-blocking sockets and error codes.  The VFS has
some regressions fixed including the ability to statvfs the root.

All changes are listed below.

py core:
- modbuiltins: add core-provided version of input() function
- objstr: catch case of negative "maxsplit" arg to str.rsplit()
- persistentcode: allow to compile with complex numbers disabled
- objstr: allow to compile with obj-repr D, and unicode disabled
- modsys: allow to compile with obj-repr D and PY_ATTRTUPLE disabled
- provide mp_decode_uint_skip() to help reduce stack usage
- makeqstrdefs.py: make script run correctly with Python 2.6
- objstringio: if created from immutable object, follow copy on write policy

extmod:
- modlwip: connect: for non-blocking mode, return EINPROGRESS
- modlwip: fix error codes for duplicate calls to connect()
- modlwip: accept: fix error code for non-blocking mode
- vfs: allow to statvfs the root directory
- vfs: allow "buffering" and "encoding" args to VFS's open()
- modframebuf: fix signed/unsigned comparison pendantic warning

lib:
- libm: use isfinite instead of finitef, for C99 compatibility
- utils/interrupt_char: remove support for KBD_EXCEPTION disabled

tests:
- basics/string_rsplit: add tests for negative "maxsplit" argument
- float: convert "sys.exit()" to "raise SystemExit"
- float/builtin_float_minmax: PEP8 fixes
- basics: convert "sys.exit()" to "raise SystemExit"
- convert remaining "sys.exit()" to "raise SystemExit"

unix port:
- convert to use core-provided version of built-in import()
- Makefile: replace references to make with $(MAKE)

windows port:
- convert to use core-provided version of built-in import()

qemu-arm port:
- Makefile: adjust object-file lists to get correct dependencies
- enable micropython.mem_*() functions to allow more tests

stmhal port:
- boards: enable DAC for NUCLEO_F767ZI board
- add support for NUCLEO_F446RE board
- pass USB handler as parameter to allow more than one USB handler
- usb: use local USB handler variable in Start-of-Frame handler
- usb: make state for USB device private to top-level USB driver
- usbdev: for MSC implement SCSI SYNCHRONIZE_CACHE command
- convert from using stmhal's input() to core provided version

cc3200 port:
- convert from using stmhal's input() to core provided version

teensy port:
- convert from using stmhal's input() to core provided version

esp8266 port:
- Makefile: replace references to make with $(MAKE)
- Makefile: add clean-modules target
- convert from using stmhal's input() to core provided version

zephyr port:
- modusocket: getaddrinfo: Fix mp_obj_len() usage
- define MICROPY_PY_SYS_PLATFORM (to "zephyr")
- machine_pin: use native Zephyr types for Zephyr API calls

docs:
- machine.Pin: remove out_value() method
- machine.Pin: add on() and off() methods
- esp8266: consistently replace Pin.high/low methods with .on/off
- esp8266/quickref: polish Pin.on()/off() examples
- network: move confusingly-named cc3200 Server class to its reference
- uos: deconditionalize, remove minor port-specific details
- uos: move cc3200 port legacy VFS mounting functions to its ref doc
- machine: sort machine classes in logical order, not alphabetically
- network: first step to describe standard network class interface

examples:
- embedding: use core-provided KeyboardInterrupt object
2017-06-20 10:56:05 -07:00
Damien George f55dcddbc7 tests/extmod/vfs_basic: Allow test to pass on embedded targets. 2017-06-11 22:56:27 +10:00
Paul Sokolovsky 85d809d1f4 tests: Convert remaining "sys.exit()" to "raise SystemExit". 2017-06-10 20:34:38 +03:00
Paul Sokolovsky a2803b74f4 tests/basics: Convert "sys.exit()" to "raise SystemExit". 2017-06-10 20:03:01 +03:00
Paul Sokolovsky 07241cd37a py/objstringio: If created from immutable object, follow copy on write policy.
Don't create copy of immutable object's contents until .write() is called
on BytesIO.
2017-06-09 17:33:01 +03:00
Paul Sokolovsky e094200750 tests/float/builtin_float_minmax: PEP8 fixes. 2017-06-08 17:23:22 +03:00
Damien George fde54350a8 tests/float: Convert "sys.exit()" to "raise SystemExit".
The latter is shorter and simpler because it doesn't require importing the
sys module.
2017-06-08 14:00:57 +10:00
Damien George f6ef8e3f17 extmod/vfs: Allow to statvfs the root directory. 2017-06-07 15:17:45 +10:00
Damien George 7400d88762 tests/basics/string_rsplit: Add tests for negative "maxsplit" argument. 2017-06-02 13:08:18 +10:00
Ville Skyttä ca16c38210 various: Spelling fixes 2017-05-29 11:36:05 +03:00
Damien George 8b13cd7e19 tests/basics: Add more tests for unwind jumps from within a try-finally.
These tests excercise cases that are fixed by the previous two commits.
2017-05-25 20:48:16 +10:00
Damien George 218a876f97 tests/basics/builtin_range: Add tests for negative slicing of range. 2017-05-18 17:32:42 +10:00
Damien George e1b0f2a16f tests/basics/list_slice_3arg: Add more tests for negative slicing. 2017-05-18 17:32:42 +10:00
Tom Collins 162a0f942b tests/io/bytesio_ext: Test read() after seek() past end of BytesIO object. 2017-05-15 23:58:06 +03:00
Paul Sokolovsky 054a381d7c tests/extmod/vfs_fat_more: Make skippable is uos is not available.
Fixes Zephyr tests.
2017-05-13 14:13:53 +03:00
Damien George cda09727b4 tests/extmod/vfs_fat: Add test for ilistdir of a non-existent directory. 2017-05-13 19:10:15 +10:00
Tom Collins 760aa0996f tests/basics/lexer: Add line continuation tests for lexer.
Tests for an issue with line continuation failing in paste mode due to the
lexer only checking for \n in the "following" character position, before
next_char() has had a chance to convert \r and \r\n to \n.
2017-05-12 15:14:25 +10:00
Damien George 852c215d76 tests/extmod/vfs: Update tests to reflect new ilistdir() method. 2017-05-10 11:39:29 +10:00
Damien George 9bd67d9fbc tests/extmod: Make some vfs tests fully unmount FSs before running.
Otherwise the existing FSs can interfere with the tests, and in some
cases the tests can write to the real FS on the device.
2017-05-09 15:50:40 +10:00
Tom Collins d00d062af2 tests/basics/lexer: Add lexer tests for input starting with newlines. 2017-05-09 14:48:00 +10:00
Damien George e711e2d44a tests/basics: Add memoryview test for big ints. 2017-05-09 10:49:19 +10:00
Damien George 2e9e14980d tests/basics: Update array test for big-int with lL typecodes. 2017-05-09 10:46:43 +10:00
Paul Sokolovsky 4a4490ffcc py/modio: resource_stream: Implement "package" param handling. 2017-05-06 18:42:35 +03:00
Damien George 084824f866 tests: Move super-as-local test from cpydiff to basic tests.
It's now possible to use the name "super" as a local variable.
2017-05-06 11:01:57 +10:00
Damien George dce7dd4259 tests/micropython: Add test for int.from_bytes with many zero bytes. 2017-05-06 10:29:09 +10:00
Damien George 1b3e372418 tests/extmod: Add some more VFS tests. 2017-05-05 20:15:10 +10:00
Damien George 6c8b57a902 tests/extmod: Add more tests for VFS FAT. 2017-05-05 20:15:10 +10:00
Paul Sokolovsky 12ea06567c tests/cpydiff/core_function_unpacking: Fill in workaround. 2017-05-04 00:48:48 +03:00
Paul Sokolovsky 92657c671f tests/cpydiff/core_import_split_ns_pkgs: Test for split namespace packages. 2017-05-03 17:16:19 +03:00
Paul Sokolovsky 3923f96dc6 tests/cpydiff/core_import_path: Test showing difference in package.__path__. 2017-05-03 12:22:53 +03:00
Paul Sokolovsky 7d4ba9d257 tests/io/resource_stream: Add test for uio.resource_stream(). 2017-05-03 01:47:14 +03:00
Paul Sokolovsky c1b19115e5 tests/cpydiff/core_import_prereg: Fill in cause and workaround. 2017-05-02 14:12:52 +03:00
Paul Sokolovsky 8bb84cc627 tests/cpydiff/core_function_userattr: Clarify, fill in cause and workaround. 2017-05-02 03:43:21 +03:00
Paul Sokolovsky 58ecbc7752 tests/cpydiff/core_arguments: Fill in cause/workaround. 2017-05-02 03:36:47 +03:00
Damien George 810133d97d tests/basics: Add tests for int.from_bytes when src has trailing zeros.
The trailing zeros should be truncated from the converted value.
2017-04-25 12:07:02 +10:00
Damien George 30badd1ce1 tests: Add tests for calling super and loading a method directly. 2017-04-22 23:39:38 +10:00
Damien George 5335942b59 py/compile: Refactor handling of special super() call.
This patch refactors the handling of the special super() call within the
compiler.  It removes the need for a global (to the compiler) state variable
which keeps track of whether the subject of an expression is super.  The
handling of super() is now done entirely within one function, which makes
the compiler a bit cleaner and allows to easily add more optimisations to
super calls.

Changes to the code size are:

   bare-arm: +12
    minimal:  +0
   unix x64: +48
unix nanbox: -16
     stmhal:  +4
     cc3200:  +0
    esp8266: -56
2017-04-22 21:46:32 +10:00
Paul Sokolovsky 9e8f316392 extmod/moductypes: Fix bigint handling for 32-bit ports. 2017-04-21 16:43:21 +03:00
Damien George c7c14f1634 tests/micropython: Add test for micropython.kbd_intr(). 2017-04-18 17:24:30 +10:00
Paul Sokolovsky 57b5ee2fcf tests/run-tests: Don't post-process CRASH result in any way.
If we got a CRASH result, return early, similar to SKIP. This is important
because previous refactor changed branching logic a bit, so CRASH now gets
post-processed into CRASH\n, which broke remote hardware tests.
2017-04-16 17:59:11 +03:00
Damien George 61616e84ce extmod/machine_signal: Rename "inverted" arg to "invert", it's shorter.
A shorter name takes less code size, less room in scripts and is faster to
type at the REPL.

Tests and HW-API examples are updated to reflect the change.
2017-04-15 21:01:47 +03:00
Paul Sokolovsky 5b8122f2bb tests/run-tests: Search feature checks wrt to main script location.
If run-tests script is run from another dir, we still want to look up
feature checks in run-tests' dir.
2017-04-14 17:07:13 +03:00
Damien George 967cad7434 tests/extmod/utimeq1: Improve coverage of utimeq module. 2017-04-13 23:34:28 +10:00
Damien George b6fff4186d tests/basics: Add test for tuple inplace add. 2017-04-05 12:38:18 +10:00
Damien George dcd8f52766 tests/basics: Add tests for raising ValueError when range() gets 0 step. 2017-04-05 10:52:29 +10:00
Peter Hinch 468c6f9da1 extmod/modframebuf: Make monochrome bitmap formats start with MONO_.
MONO_xxx is much easier to read if you're not familiar with the code.
MVLSB is deprecated but kept for backwards compatibility, for the time
being.

This patch also updates the associated docs and tests.
2017-04-04 17:38:33 +10:00
Damien George 805b1c8bc3 tests/run-tests: Update names of tests that may need skipping. 2017-04-04 12:26:43 +10:00
Damien George 677fb31015 tests/float: Add tests for hashing float and complex numbers. 2017-04-04 12:14:34 +10:00
Paul Sokolovsky 831e157226 tests/run-tests: Introduce generic "minimal" target.
Used e.g. by Zephyr port.
2017-04-03 10:20:48 +03:00
Paul Sokolovsky 806c07c898 tests/micropython/heapalloc_iter: Improve skippability. 2017-04-03 00:27:01 +03:00