summaryrefslogtreecommitdiffstatshomepage
path: root/tests/cmdline
Commit message (Collapse)AuthorAge
* tests: Add tests for calling super and loading a method directly.Damien George2017-04-22
|
* py/compile: Refactor handling of special super() call.Damien George2017-04-22
| | | | | | | | | | | | | | | | | | | 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
* py: Create str/bytes objects in the parser, not the compiler.Damien George2017-02-24
| | | | | | | | | | | | | | | | | | 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.
* tests/cmdline/cmd_parsetree: Update to work with changes to grammar.Damien George2017-02-17
|
* tests/cmdline: Update cmd_parsetree test for changes to grammar order.Damien George2017-02-16
|
* tests/cmdline/cmd_showbc: Update to work with recent changes.Damien George2017-02-16
|
* tests/cmdline: Update tests to pass with latest changes to bytecode.Damien George2017-02-16
|
* py: Allow bytecode/native to put iter_buf on stack for simple for loops.Damien George2017-02-16
| | | | | 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).
* tests/cmdline: Improve repl.c autocomplete test coverage.Rami Ali2016-12-29
|
* tests: Add a coverage test for printing the parse-tree.Damien George2016-12-22
|
* tests/cmdline: Improve coverage test for printing bytecode.Damien George2016-10-17
|
* tests: Improve test coverage of py/compile.c.Damien George2016-10-11
|
* tests: Fix expected output of verbose cmdline teststijn2016-10-05
| | | | | | The output might contain more than one line ending in 5b so properly skip everything until the next known point. This fixes test failures in appveyor debug builds.
* tests/cmdline/cmd_showbc: Fix test now that 1 value is stored on stack.Damien George2016-09-27
| | | | | This corresponds to the change in the way exception values are stored on the Python value stack.
* tests: Get cmdline verbose tests running again.Damien George2016-09-20
| | | | | The showbc function now no longer uses the system printf so works correctly.
* tests/cmdline: Add test for -O option to check optimisation value.Damien George2016-08-26
|
* py/repl: Check for an identifier char after the keyword.Alex March2016-02-17
| | | | | - As described in the #1850. - Add cmdline tests.
* unix: Add exit and paste-mode hints to shell startup banner.Damien George2015-10-12
| | | | Thanks to @nyov for the initial patch.
* Rename "Micro Python" to "MicroPython" in REPL, help, readme's and misc.Damien George2015-10-12
|
* tests: Add escaped quotes tests for REPL.Alex March2015-09-19
| | | | | | | Test possible combinations of single and double quotes with escaped quotes and parenthesis with and without function calls in REPL. Covers: #1419
* unix: Enable REPL auto-indent.Damien George2015-09-12
|
* tests: Consolidate all feature check snippets under feature_check/.Paul Sokolovsky2015-08-30
|
* tests: Remove over-specification of startup bannerTom Soulanille2015-08-08
|
* run-tests: Test REPL emacs keys, but only if present.Tom Soulanille2015-08-06
| | | | | Uses cmdline/repl_emacs_check.py to check for presence of emacs keys in repl before doing full feature test.
* run-tests: Use PTY when running REPL tests.Tom Soulanille2015-07-26
|
* py: Remove mp_load_const_bytes and instead load precreated bytes object.Damien George2015-06-25
| | | | | | | | | | | | | | | | Previous to this patch each time a bytes object was referenced a new instance (with the same data) was created. With this patch a single bytes object is created in the compiler and is loaded directly at execute time as a true constant (similar to loading bignum and float objects). This saves on allocating RAM and means that bytes objects can now be used when the memory manager is locked (eg in interrupts). The MP_BC_LOAD_CONST_BYTES bytecode was removed as part of this. Generated bytecode is slightly larger due to storing a pointer to the bytes object instead of the qstr identifier. Code size is reduced by about 60 bytes on Thumb2 architectures.
* py: Add MP_BINARY_OP_DIVMOD to simplify and consolidate divmod builtin.Damien George2015-06-13
|
* unix: Add option to use uPy readline, and enable by default.Damien George2015-05-27
| | | | | | This gets uPy readline working with unix port, with tab completion and history. GNU readline is still supported, configure using MICROPY_USE_READLINE variable.
* py: Convert hash API to use MP_UNARY_OP_HASH instead of ad-hoc function.Damien George2015-05-12
| | | | | | | | | | | | | | Hashing is now done using mp_unary_op function with MP_UNARY_OP_HASH as the operator argument. Hashing for int, str and bytes still go via fast-path in mp_unary_op since they are the most common objects which need to be hashed. This lead to quite a bit of code cleanup, and should be more efficient if anything. It saves 176 bytes code space on Thumb2, and 360 bytes on x86. The only loss is that the error message "unhashable type" is now the more generic "unsupported type for __hash__".
* py: Fix naming of function arguments when function is a closure.Damien George2015-05-06
| | | | Addresses issue #1226.
* tests: Fix cmd_showbc now that LOAD_CONST_ELLIPSIS bytecode is gone.Damien George2015-05-05
|
* py: Modify bytecode "with" behaviour so it doesn't use any heap.Damien George2015-04-24
| | | | | | Before this patch a "with" block needed to create a bound method object on the heap for the __exit__ call. Now it doesn't because we use load_method instead of load_attr, and save the method+self on the stack.
* py: Simplify bytecode prelude when encoding closed over variables.Damien George2015-04-07
|
* tests: Add missing tests for builtins, and many other things.Damien George2015-04-04
|
* tests: Adjust expected output, since Travis can't do git describe.Damien George2015-03-20
|
* tests: Make cmdline tests more stable by using regex for matching.Damien George2015-03-20
|
* tests: Don't try to verify amount of memory used in cmd_showbc test.Damien George2015-03-14
|
* tests: Add cmdline test to test showbc code.Damien George2015-03-14
|
* tests: Add ability to test uPy cmdline executable.Damien George2015-03-13
This allows to test options passed to cmdline executable, as well as the behaviour of the REPL.