summaryrefslogtreecommitdiffstatshomepage
path: root/tools/tinytest-codegen.py
Commit message (Collapse)AuthorAge
* tools/tinytest-codegen.py: Externalise tests list.Alessandro Gatti2023-11-07
| | | | | | | | | | | | | | | Remove port-specific test directories and excluded tests from tinytest-codegen, and let it read said information from an external file. This way tinytest-codegen is not limited to always generate tests for the `qemu-arm` target. This allows having port-specific test directory and excluded tests for more than one QEMU bare-metal target. The `qemu-arm` port Makefile was modified to work with the generator changes and a tests profile file was added to said port. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
* extmod/modtimeq: Remove timeq module.Jim Mussared2023-06-08
| | | | | | | | This is a MicroPython-specific module that existed to support the old version of uasyncio. It's undocumented and not enabled on all ports and takes up code size unnecessarily. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tests: Replace umodule with module everywhere.Jim Mussared2023-06-08
| | | | | | This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* py/formatfloat: Format all whole-number floats exactly.Dan Ellis2022-07-26
| | | | | | | | | | | | | Formerly, py/formatfloat would print whole numbers inaccurately with nonzero digits beyond the decimal place. This resulted from its strategy of successive scaling of the argument by 0.1 which cannot be exactly represented in floating point. The change in this commit avoids scaling until the value is smaller than 1, so all whole numbers print with zero fractional part. Fixes issue #4212. Signed-off-by: Dan Ellis dan.ellis@gmail.com
* tests/basics: Split f-string debug printing to separate file with .exp.Damien George2021-08-26
| | | | | | | | | This feature {x=} was introduced in Python 3.8 so needs a separate .exp file to run on earlier Python versions. See https://bugs.python.org/issue36817 Signed-off-by: Damien George <damien@micropython.org>
* py: Implement partial PEP-498 (f-string) support.Jim Mussared2021-08-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements (most of) the PEP-498 spec for f-strings and is based on https://github.com/micropython/micropython/pull/4998 by @klardotsh. It is implemented in the lexer as a syntax translation to `str.format`: f"{a}" --> "{}".format(a) It also supports: f"{a=}" --> "a={}".format(a) This is done by extracting the arguments into a temporary vstr buffer, then after the string has been tokenized, the lexer input queue is saved and the contents of the temporary vstr buffer are injected into the lexer instead. There are four main limitations: - raw f-strings (`fr` or `rf` prefixes) are not supported and will raise `SyntaxError: raw f-strings are not supported`. - literal concatenation of f-strings with adjacent strings will fail "{}" f"{a}" --> "{}{}".format(a) (str.format will incorrectly use the braces from the non-f-string) f"{a}" f"{a}" --> "{}".format(a) "{}".format(a) (cannot concatenate) - PEP-498 requires the full parser to understand the interpolated argument, however because this entirely runs in the lexer it cannot resolve nested braces in expressions like f"{'}'}" - The !r, !s, and !a conversions are not supported. Includes tests and cpydiffs. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tools/tinytest-codegen.py: Add command-line option to exclude tests.Damien George2021-05-26
| | | | Signed-off-by: Damien George <damien@micropython.org>
* py/objexcept: Allow compression of exception message text.Jim Mussared2020-04-05
| | | | | | The decompression of error-strings is only done if the string is accessed via printing or via er.args. Tests are added for this feature to ensure the decompression works.
* all: Reformat C and Python source code with tools/codeformat.py.Damien George2020-02-28
| | | | This is run with uncrustify 0.70.1, and black 19.10b0.
* tools/tinytest-codegen.py: Add extra newline and result message.David Lechner2019-12-19
| | | | | | | | This is an alternative to f4ed2df that adds a newline so that the output of the test starts on a new line and the result of the test is prefixed with "result: " to distinguish it from the test output. Suggested-by: @dpgeorge
* tests: Add tests for sys.settrace feature.Milan Rossa2019-08-30
|
* qemu-arm: Add testing of frozen native modules.Jim Mussared2019-08-20
| | | | | | | - Split 'qemu-arm' from 'unix' for generating tests. - Add frozen module to the qemu-arm test build. - Add test that reproduces the requirement to half-word align native function data.
* tools/tinytest-codegen: Ignore system locale, write output in UTF-8.Paul Sokolovsky2017-12-15
| | | | | | Way to reproduce a UnicodeEncodeError without this patch: LC_ALL=C tinytest-codegen.py ...
* tools/tinytest-codegen: Add --stdin switch instead of recently added --target.Paul Sokolovsky2017-12-14
| | | | | | Instead of passing thru more and more options from tinytest-codegen to run-tests --list-tests, pipe output of run-tests --list-tests into tinytest-codegen.
* tools/tinytest-codegen: Take --target= option for test set selection.Paul Sokolovsky2017-12-13
| | | | | | | | | | | Gets passed to run-tests --list-tests to get actual list of tests to use. If --target= is not given, legacy set hardcoded in tinytest-codegen itself is used. Also, get rid of tinytest test groups - they aren't really used for anything, and only complicate processing. Besides, one of the next step is to limit number of tests per a generated file to control the binary size, which also will require "flat" list of tests.
* tools/tinytest-codegen: More excludes after enabling expected output match.Paul Sokolovsky2017-12-13
|
* tools/tinytest-codegen: Wrap lines of exclude_tests.Paul Sokolovsky2017-12-13
| | | | So it was manageable and extensible.
* tools/tinytest-codegen.py: Generate code for upytesthelper.Paul Sokolovsky2017-12-13
| | | | | | | | | | | The way tinytest was used in qemu-arm test target is that it didn't test much. MicroPython tests are based on matching the test output against reference output, but qemu-arm's implementation didn't do that, it effectively tested just that there was no exception during test execution. "upytesthelper" wrapper was introduce to fix it, and so test generator is now switched to generate test code for it. Also, fix PEP8 and other codestyle issues.
* tools/tinytest-codegen: Update for recent test renaming ("intbig" suffix).Paul Sokolovsky2017-03-06
|
* qemu-arm: Enable machine module and associated tests.Damien George2017-03-02
|
* qemu-arm: Don't compile tests in "REPL" mode.Damien George2017-01-27
| | | | | | | | | | Previous to this patch the qemu-arm tests were compiled with is_relp=true meaning that the __repl_print__ function was called for all lines of code in the outer scope. This is not the right behaviour for scripts that are executed as though they were a file (eg tests). With this fix the micropython/heapalloc_str.py test now works so it is removed from the test blacklist.
* tools/tinytest-codegen.py: Blacklist heapalloc_str.py test for qemu-arm.Paul Sokolovsky2017-01-27
|
* tools/tinytest-codegen: Blacklist recently added uheapq_timeq test (qemu-arm).Paul Sokolovsky2016-11-12
|
* qemu-arm: Enable software floating point support, and float tests.Damien George2016-11-03
| | | | | | | | | This helps to test floating point code on Cortex-M hardware. As part of this patch the link-time-optimisation was disabled because it wasn't compatible with software FP support. In particular, the linker could not find the __aeabi_f2d, __aeabi_d2f etc functions even though they were provided by lib/libm/math.c.
* tools/tinytest-codegen: Exclude ticks_diff test for qemu-arm port.Paul Sokolovsky2016-10-30
|
* qemu-arm: Exclude new vfs_fat tests.Alex March2016-10-27
|
* qemu-arm: Exclude extmod/vfs_fat_fileio.py test.Alex March2016-10-24
|
* qemu-arm: Enable lots of extmods and enable tests for them.Damien George2016-10-14
| | | | | The qemu-arm port is used for testing of ARM Thumb architecture on a desktop so should have many features enabled.
* qemu-arm: Enable builtin override feature, and enable more tests.Damien George2016-03-15
| | | | Hopefully these tests run reliably on Travis.
* qemu-arm: Disable inline asm tests that use floating point.Damien George2015-04-19
|
* qemu-arm: Disable try_finally1.py test (it fails randomly on Travis).Damien George2015-01-25
|
* qemu-arm: Disable basics/memoryerror.py test.Damien George2015-01-12
|
* qemu-arm: Enable GC and native code-gen; enable more tests.Damien George2015-01-12
|
* qemu-arm: Add 'test' target to Makefile to run and verify test suite.Damien George2015-01-09
| | | | | | | Replaces RUN_TEST=1 definition; now "make test" in qemu-arm directory will run tests/basics/ and check that they all succeed. This patch also enables the test on Travis CI.
* tools: inline test suite generator.Ilya Dmitrichenko2014-05-08