summaryrefslogtreecommitdiff
path: root/ports/unix/variants/coverage
AgeCommit message (Collapse)Author
2025-07-06unix/variants/coverage: Enable sys.settrace.Jeff Epler
The unix coverage variant should have all features enabled, so they can be tested for coverage. Therefore, enabled `MICROPY_PY_SYS_SETTRACE`. Signed-off-by: Jeff Epler <jepler@gmail.com>
2025-06-04unix/coverage: Add coverage test for mp_sched_schedule_node.Andrew Leech
Test modified to reschedule itself based on a flag setting. Without the change in the parent commit, this test executes the callback indefinitely and hangs but with the change it runs only once each time mp_handle_pending() is called. Modified-by: Angus Gratton <angus@redyak.com.au> Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2025-04-21unix/variants: Enable os.uname() in coverage build for tests.Yoctopuce dev
In order to provide test coverage for the previous commit, `os.uname()` support is added to the unix coverage build. Signed-off-by: Yoctopuce dev <dev@yoctopuce.com>
2025-03-06unix/main: Add coverage test for mounting ROMFS filesystem at startup.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2024-02-16tests/ports/unix: Add coverage test for frozen functions and generators.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2024-02-08unix/variants: Prefer unix-ffi packages when loading the manifest.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2024-02-07extmod/modtls: Move the native ssl module to tls.Felix Dörre
The current `ssl` module has quite a few differences to the CPython implementation. This change moves the MicroPython variant to a new `tls` module and provides a wrapper module for `ssl` (in micropython-lib). Users who only rely on implemented comparible behavior can continue to use `ssl`, while users that rely on non-compatible behavior should switch to `tls`. Then we can make the facade in `ssl` more strictly adhere to CPython. Signed-off-by: Felix Dörre <felix@dogcraft.de>
2023-06-08all: Rename UMODULE to MODULE in preprocessor/Makefile vars.Jim Mussared
This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-04-26extmod/btstack: Fix indicate/notify queuing.Jim Mussared
This adds a mechanism to track a pending notify/indicate operation that is deferred due to the send buffer being full. This uses a tracked alloc that is passed as the content arg to the callback. This replaces the previous mechanism that did this via the global pending op queue, shared with client read/write ops. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-19unix/variants/coverage: Add test for manifest freeze_mpy().Jim Mussared
This uses the frozentest.mpy that is also used by ports/minimal. Also fixes two bugs that these new tests picked up: - File extension matching in manifestfile.py. - Handling of freeze_mpy results in makemanifest. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-13unix: Refactor mpconfigvariant.mk.Jim Mussared
All variants (except minimal) enable text compression and fat/lfs, so move them to the common mpconfigport.mk. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-13py/mpconfig: Add "everything" features from unix coverage.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-13unix: Refactor mpconfigport.h and mpconfigvariant.h.Jim Mussared
This is a no-op for coverage and minimal. The standard and dev variants have been merged and enable the same feature set as a typical bare-metal board. And remove the CI for the dev build. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-11unix/variants: Remove variant suffix from executable filename.Damien George
The executable now lives in the build directory, and since the build directory already contains the variant name there is no need to also add it to the executable. Signed-off-by: Damien George <damien@micropython.org>
2022-07-23unix: Enable MICROPY_GC_SPLIT_HEAP on coverage build.Rob Knegjens
With a new option to evenly split the GC heap over multiple areas. This adds code coverage for gc_add() and code associated with MICROPY_GC_SPLIT_HEAP.
2022-06-29unix/variants/coverage: Change config to use ROM level everything.Damien George
This ROM level is not yet fully defined, but it at least enables MICROPY_PY_SYS_TRACEBACKLIMIT. The coverage build should have everything enabled, so it makes sense to use this ROM level for it. Signed-off-by: Damien George <damien@micropython.org>
2022-06-29unix/variants: Enable remaining options on dev,coverage from ROM extra.Damien George
So that the default configuration for the dev and coverage variants includes all options set by MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES. Note that enabling MICROPY_PY_SYS_STDIO_BUFFER on unix doesn't do anything because unix doesn't use shared/runtime/sys_stdio_mphal.c. Signed-off-by: Damien George <damien@micropython.org>
2022-06-29unix/variants: Move setting of MICROPY_PY_USELECT to port config file.Damien George
The default is the same as before: MICROPY_PY_USELECT=0 and MICROPY_PY_USELECT_POSIX=1. But now this can be easily overridden at the make command-line using, eg: make VARIANT=dev CFLAGS_EXTRA=-DMICROPY_PY_USELECT=1 Signed-off-by: Damien George <damien@micropython.org>
2022-06-07unix/variants: Enable seeding random module on import in dev, coverage.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-05-05py/malloc: Introduce m_tracked_calloc, m_tracked_free functions.Damien George
Enabled by MICROPY_TRACKED_ALLOC. Signed-off-by: Damien George <damien@micropython.org>
2022-04-20ports: Reformat more C and Python source code.Damien George
These files that are reformatted only now fall under the list of files to apply uncrustify/black formatting to. Signed-off-by: Damien George <damien@micropython.org>
2022-03-10unix/variants: Enable a few optimisations and features on dev, coverage.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-03-10unix/variants: Use rom feature config for standard, dev, coverage.Damien George
This change is a no-op in terms of functionality. Signed-off-by: Damien George <damien@micropython.org>
2022-03-10py/modsys: Add optional mutable attributes sys.ps1/ps2 and use them.Damien George
This allows customising the REPL prompt strings. Signed-off-by: Damien George <damien@micropython.org>
2022-03-10py/modsys: Add optional sys.tracebacklimit attribute.Damien George
With behaviour as per CPython. Signed-off-by: Damien George <damien@micropython.org>
2022-03-09unix/moduos: Convert module to use extmod version.Damien George
All variants now use extmod/moduos.c as their uos module implementation. In particular this means they all have MICROPY_VFS enabled and use VfsPosix for their filesystem. As part of this, the available functions in uos become more consistent with other ports: - coverage variant gets uos.urandom - minimal and standard variant get: unlink, chdir, getcwd, listdir Signed-off-by: Damien George <damien@micropython.org>
2022-02-28tests/unix: Add coverage test for freezing various objects.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-01-23py/modmath: Add math.tau, math.nan and math.inf constants.stijn
Configurable by the new MICROPY_PY_MATH_CONSTANTS option.
2021-12-17py/modio: Remove io.resource_stream function.Jim Mussared
This feature is not enabled on any port, it's not in CPython's io module, and functionality is better suited to the micropython-lib implementation of pkg_resources.
2021-04-01examples/usercmodules: Simplify user C module enabling.Damien George
It's a bit of a pitfall with user C modules that including them in the build does not automatically enable them. This commit changes the docs and examples for user C modules to encourage writers of user C modules to enable them unconditionally. This makes things simpler and covers most use cases. See discussion in issue #6960, and also #7086. Signed-off-by: Damien George <damien@micropython.org>
2020-10-29unix/Makefile: Move coverage.c and coveragecpp.cpp to coverage variant.Damien George
So that g++ is not needed to build a non-coverage unix variant. Signed-off-by: Damien George <damien@micropython.org>
2020-10-29examples: Add example code for user C modules, both C and C++.stijn
Add working example code to provide a starting point for users with files that they can just copy, and include the modules in the coverage test to verify the complete user C module build functionality. The cexample module uses the code originally found in cmodules.rst, which has been updated to reflect this and partially rewritten with more complete information.
2020-10-01unix/variants: Enable MICROPY_DEBUG_PARSE_RULE_NAME on coverage build.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-09-18tests/basics: Add test for MICROPY_PY_ALL_INPLACE_SPECIAL_METHODS ops.Damien George
And enable this feature on unix, the coverage variant. The .exp test file is needed so the test can run on CPython versions prior to "@=" operator support. Signed-off-by: Damien George <damien@micropython.org>
2020-09-08unix: Implement BLE H4 HCI UART for btstack/nimble.Jim Mussared
This commit adds support for using Bluetooth on the unix port via a H4 serial interface (distinct from a USB dongle), with both BTstack and NimBLE Bluetooth stacks. Note that MICROPY_PY_BLUETOOTH is now disabled for the coverage variant. Prior to this commit Bluetooth was anyway not being built on Travis because libusb was not detected. But now that bluetooth works in H4 mode it will be built, and will lead to a large decrease in coverage because Bluetooth tests cannot be run on Travis.
2020-07-01unix: Make manifest selection match other ports.Jim Mussared
Changes are: - The default manifest.py is moved to the variants directory (it's in "boards" in other ports). - The coverage variant now uses a custom manifest in its variant directory to add frzmpy/frzstr. - The frzmpy/frzstr tests are moved to variants/coverage/.
2020-04-29unix: Enable modbluetooth on the "dev" and "coverage" variants.Jim Mussared
And MICROPY_PY_URANDOM_EXTRA_FUNCS is enabled on "dev" so tha the Bluetooth examples all run.
2020-04-18all: Enable extra conversion warnings where applicable.stijn
Add -Wdouble-promotion and -Wfloat-conversion for most ports to ban out implicit floating point conversions, and add extra Travis builds using MICROPY_FLOAT_IMPL_FLOAT to uncover warnings which weren't found previously. For the unix port -Wsign-comparison is added as well but only there since only clang supports this but gcc doesn't.
2020-04-13unix: Fix behaviour of COPT/NDEBUG for unix variants.Jim Mussared
Based on eg 1e6fd9f2b4072873f5d6846b19b2ef0ccc5e4e52, it's understood that the intention for unix builds is that regular builds disable assert, but the coverage build should set -O0 and enable asserts. It looks like this didn't work (even before variants were introduced, eg at v1.11) -- coverage always built with -Os and -DNDEBUG. This commit makes it possible for variants to have finer-grained control over COPT flags, and enables assert() and -O0 on coverage builds. Other variants already match the defaults so they have been updated.
2020-04-05ports: Enable error text compression for various ports, but not all.Jim Mussared
Enabled on: bare-arm, minimal, unix coverage/dev/minimal, stm32, esp32, esp8266, cc3200, teensy, qemu-arm, nrf. Not enabled on others to be able to test the code when the feature is disabled (the default case). Code size change for this commit: bare-arm: -600 -0.906% minimal x86: -308 -0.208% unix x64: +0 +0.000% unix nanbox: +0 +0.000% stm32: -3368 -0.869% PYBV10 cc3200: -1024 -0.558% esp8266: -2512 -0.368% GENERIC esp32: -2876 -0.205% GENERIC[incl -3168(data)] nrf: -1708 -1.173% pca10040 samd: +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
2020-03-26unix: Enable uasyncio C helper module on coverage build.Damien George
2020-03-18unix: Remove custom file implementation to use extmod's VFS POSIX one.Damien George
The implementation in extmod/vfs_posix_file.c is now equivalent to that in ports/unix/file.c, so remove the latter and use the former instead.
2020-03-11py/modmicropython: Add heap_locked function to test state of heap.Andrew Leech
This commit adds micropython.heap_locked() which returns the current lock-depth of the heap, and can be used by Python code to check if the heap is locked or not. This new function is configured via MICROPY_PY_MICROPYTHON_HEAP_LOCKED and is disabled by default. This commit also changes the return value of micropython.heap_unlock() so it returns the current lock-depth as well.
2020-01-24unix/Makefile: Reserve CFLAGS_EXTRA/LDFLAGS_EXTRA for external use.Damien George
When CFLAGS_EXTRA/LDFLAGS_EXTRA (or anything) is set on the command line of a make invocation then it will completely override any setting or appending of these variables in the makefile(s). This means builds like the coverage variant will have their mpconfigvariant.mk settings overridden. Fix this by using CFLAGS/LDFLAGS exclusively in the makefile(s), reserving the CFLAGS_EXTRA/LDFLAGS_EXTRA variables for external command-line use only.
2020-01-12lib/mp-readline: Add word-based move/delete EMACS key sequences.Yonatan Goldschmidt
This commit adds backward-word, backward-kill-word, forward-word, forward-kill-word sequences for the REPL, with bindings to Alt+F, Alt+B, Alt+D and Alt+Backspace respectively. It is disabled by default and can be enabled via MICROPY_REPL_EMACS_WORDS_MOVE. Further enabling MICROPY_REPL_EMACS_EXTRA_WORDS_MOVE adds extra bindings for these new sequences: Ctrl+Right, Ctrl+Left and Ctrl+W. The features are enabled on unix micropython-coverage and micropython-dev.
2020-01-12unix: Rename unix binaries to micropython-variant (not _variant).Jim Mussared
For consistency with mpy-cross, and other unix tools in general.
2020-01-12unix: Add build variants, analogous to boards on bare-metal.Jim Mussared
Invoking "make" will still build the standard "micropython" executable, but other variants are now build using, eg, "make VARIANT=minimal". This follows how bare-metal ports specify a particular board, and allows running any make target (eg clean, test) with any variant. Convenience targets (eg "make coverage") are provided to retain the old behaviour, at least for now. See issue #3043.