summaryrefslogtreecommitdiffstatshomepage
path: root/tests
Commit message (Collapse)AuthorAge
* unix-cpy: Remove unix-cpy. It's no longer needed.Damien George2015-08-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unix-cpy was originally written to get semantic equivalent with CPython without writing functional tests. When writing the initial implementation of uPy it was a long way between lexer and functional tests, so the half-way test was to make sure that the bytecode was correct. The idea was that if the uPy bytecode matched CPython 1-1 then uPy would be proper Python if the bytecodes acted correctly. And having matching bytecode meant that it was less likely to miss some deep subtlety in the Python semantics that would require an architectural change later on. But that is all history and it no longer makes sense to retain the ability to output CPython bytecode, because: 1. It outputs CPython 3.3 compatible bytecode. CPython's bytecode changes from version to version, and seems to have changed quite a bit in 3.5. There's no point in changing the bytecode output to match CPython anymore. 2. uPy and CPy do different optimisations to the bytecode which makes it harder to match. 3. The bytecode tests are not run. They were never part of Travis and are not run locally anymore. 4. The EMIT_CPYTHON option needs a lot of extra source code which adds heaps of noise, especially in compile.c. 5. Now that there is an extensive test suite (which tests functionality) there is no need to match the bytecode. Some very subtle behaviour is tested with the test suite and passing these tests is a much better way to stay Python-language compliant, rather than trying to match CPy bytecode.
* py: Add stream_tell method, and use for unix and stmhal file tell.blmorris2015-08-13
|
* tests: Remove over-specification of startup bannerTom Soulanille2015-08-08
|
* tests: Fix exceptions when running cmdline tests on windowsstijn2015-08-08
| | | | | | | - subprocess.check_output can only handle strings on windows, not bytes, so convert the arguments as such - the pty module is for posix systems only so skip the tests needing it in case it is not available
* tests: Always use forward slashes for pathsstijn2015-08-08
| | | | | This is more consistent and fixes run_micropython on windows as it uses forward slahses to compare paths
* 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.
* tests: Add test for pyboard SPI in slave mode, recv with no master.Damien George2015-08-05
| | | | See PR #1414.
* py/objlist: Make list += accept all arguments and add test.Damien George2015-08-02
|
* run-tests: Use PTY when running REPL tests.Tom Soulanille2015-07-26
|
* tools: Add telnet support to pyboard.py.Daniel Campora2015-07-26
| | | | | | | The adapter class "TelnetToSerial" is used to access the Telnet connection using the same API as with the serial connection. The function pyboard.run-test() has been removed to made the module generic and because this small test is no longer needed.
* tests: Skip parser test if "compile" builtin is not available.Damien George2015-07-24
|
* py/parse: Fix handling of empty input so it raises an exception.Damien George2015-07-24
|
* py/lexer: Raise SyntaxError when str hex escape sequence is malformed.Damien George2015-07-23
| | | | Addresses issue #1390.
* py: Allow viper functions to take up to 4 arguments.Damien George2015-07-23
| | | | Addresses issue #1380.
* py: Implement memoryview slice assignment.Delio Brignoli2015-07-20
| | | | | Adds ability to do "memcpy" with memoryview objects, such as: m1[0:3] = m2[2:5].
* modbuiltins: Implement round() to precision.Sebastian Plamauer2015-07-19
|
* modmachine: Implement physical memory access using /dev/mem (Linux, etc).Paul Sokolovsky2015-07-08
| | | | | | | | | | This requires root access. And on recent Linux kernels, with CONFIG_STRICT_DEVMEM option enabled, only address ranges listed in /proc/iomem can be accessed. The above compiled-time option can be however overriden with boot-time option "iomem=relaxed". This also removed separate read/write paths - there unlikely would be a case when they're different.
* tests: Catch ValueError instead of any exception to properly test error.Damien George2015-07-06
|
* extmod: Add a2b_base64 and b2a_base64 functions to ubinascii.Galen Hazelwood2015-07-04
|
* tests: Add test for relative import without package context.Paul Sokolovsky2015-06-27
|
* 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.
* tests: Split out json float tests to separate files.Damien George2015-06-25
|
* tests: Add support for the WiPy in run-tests script.Daniel Campora2015-06-25
| | | | | | | The --pyboard param has been replaced by --target which defaults to 'unix'. Possible values at this moment are 'unix', 'pyboard' and 'wipy'. Now is also possible to select the baud rate of the serial device when calling the script.
* tests: Adapt misc/features.py tests for ports without floating point.Daniel Campora2015-06-24
|
* tests: Adapt basics/memoryerror.py for ports with lower heap sizes.Daniel Campora2015-06-24
|
* tests: Add testcase for open(..., "a").Paul Sokolovsky2015-06-21
|
* py: Use a wrapper to explicitly check self argument of builtin methods.Damien George2015-06-20
| | | | | | | | | | | | | | | Previous to this patch a call such as list.append(1, 2) would lead to a seg fault. This is because list.append is a builtin method and the first argument to such methods is always assumed to have the correct type. Now, when a builtin method is extracted like this it is wrapped in a checker object which checks the the type of the first argument before calling the builtin function. This feature is contrelled by MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG and is enabled by default. See issue #1216.
* tests: Check that machine module exists and print SKIP if it doesn't.Damien George2015-06-15
|
* py: Implement divmod for mpz bignum.Damien George2015-06-13
|
* py: Add MP_BINARY_OP_DIVMOD to simplify and consolidate divmod builtin.Damien George2015-06-13
|
* py: Implement second arg for math.log (optional value for base).Damien George2015-06-13
|
* py: Support unicode (utf-8 encoded) identifiers in Python source.Damien George2015-06-09
| | | | Enabled simply by making the identifier lexing code 8-bit clean.
* py: Fallback to stack alloca for Python-stack if heap alloc fails.Damien George2015-06-08
| | | | | | If heap allocation for the Python-stack of a function fails then we may as well allocate the Python-stack on the C stack. This will allow to run more code without using the heap.
* moductypes: Swap address and descriptor args in constructor.Paul Sokolovsky2015-06-06
| | | | | | | | Now address comes first, and args related to struct type are groupped next. Besides clear groupping, should help catch errors eagerly (e.g. forgetting to pass address will error out). Also, improve args number checking/reporting overall.
* unix: Allow to cat a script into stdin from the command line.Damien George2015-06-04
| | | | See issue #1306.
* py: Implement native multiply operation in viper emitter.Damien George2015-06-04
|
* py: Implement implicit cast to obj for viper load/store index/value.Damien George2015-06-04
| | | | | | | This allows to do "ar[i]" and "ar[i] = val" in viper when ar is a Python object and i and/or val are native viper types (eg ints). Patch also includes tests for this feature.
* tests: Add test for recursive iternext stack overflow.Damien George2015-06-03
|
* tests: Add special tests to test mp_printf function to improve coverage.Damien George2015-05-28
|
* tests: Add some tests for printing floats to improve coverage.Damien George2015-05-28
|
* py: Remove unnecessary extra handling of padding of nan/inf.Damien George2015-05-28
| | | | | | | C's printf will pad nan/inf differently to CPython. Our implementation originally conformed to C, now it conforms to CPython's way. Tests for this are also added in this patch.
* tests: Add tests to create valid and invalid UART, I2C, SPI, CAN busses.Damien George2015-05-28
|
* 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.
* lib: Fix some issues in timeutilsDave Hylands2015-05-21
| | | | | | | | | | | | | | | | | | | In particular, dates prior to Mar 1, 2000 are screwed up. The easiest way to see this is to do: >>> import time >>> time.localtime(0) (2000, 1, 1, 0, 0, 0, 5, 1) >>> time.localtime(1) (2000, 1, 2, 233, 197, 197, 6, 2) With this patch, we instead get: >>> import time >>> time.localtime(1) (2000, 1, 1, 0, 0, 1, 5, 1) Doh - In C % is NOT a modulo operator, it's a remainder operator.
* extmod: Add ubinascii.unhexlifyDave Hylands2015-05-20
| | | | This also pulls out hex_digit from py/lexer.c and makes unichar_hex_digit
* py: Implement mp_format_float for doubles and use where appropriatestijn2015-05-17
| | | | | | | This allows using (almost) the same code for printing floats everywhere, removes the dependency on sprintf and uses just snprintf and applies an msvc-specific fix for snprintf in a single place so nan/inf are now printed correctly.
* py: Fix printing of complex number when imaginary part is nanstijn2015-05-13
|
* unix: Add some extra coverage tests for vstr and attrtuple.Damien George2015-05-12
|
* tests: Add further tests for class defining __hash__.Damien George2015-05-12
|
* 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__".