aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2015-08-13py: Add stream_tell method, and use for unix and stmhal file tell.blmorris
2015-08-08tests: Remove over-specification of startup bannerTom Soulanille
2015-08-08tests: Fix exceptions when running cmdline tests on windowsstijn
- 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
2015-08-08tests: Always use forward slashes for pathsstijn
This is more consistent and fixes run_micropython on windows as it uses forward slahses to compare paths
2015-08-06run-tests: Test REPL emacs keys, but only if present.Tom Soulanille
Uses cmdline/repl_emacs_check.py to check for presence of emacs keys in repl before doing full feature test.
2015-08-05tests: Add test for pyboard SPI in slave mode, recv with no master.Damien George
See PR #1414.
2015-08-02py/objlist: Make list += accept all arguments and add test.Damien George
2015-07-26run-tests: Use PTY when running REPL tests.Tom Soulanille
2015-07-26tools: Add telnet support to pyboard.py.Daniel Campora
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.
2015-07-24tests: Skip parser test if "compile" builtin is not available.Damien George
2015-07-24py/parse: Fix handling of empty input so it raises an exception.Damien George
2015-07-23py/lexer: Raise SyntaxError when str hex escape sequence is malformed.Damien George
Addresses issue #1390.
2015-07-23py: Allow viper functions to take up to 4 arguments.Damien George
Addresses issue #1380.
2015-07-20py: Implement memoryview slice assignment.Delio Brignoli
Adds ability to do "memcpy" with memoryview objects, such as: m1[0:3] = m2[2:5].
2015-07-19modbuiltins: Implement round() to precision.Sebastian Plamauer
2015-07-08modmachine: Implement physical memory access using /dev/mem (Linux, etc).Paul Sokolovsky
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.
2015-07-06tests: Catch ValueError instead of any exception to properly test error.Damien George
2015-07-04extmod: Add a2b_base64 and b2a_base64 functions to ubinascii.Galen Hazelwood
2015-06-27tests: Add test for relative import without package context.Paul Sokolovsky
2015-06-25py: Remove mp_load_const_bytes and instead load precreated bytes object.Damien George
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.
2015-06-25tests: Split out json float tests to separate files.Damien George
2015-06-25tests: Add support for the WiPy in run-tests script.Daniel Campora
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.
2015-06-24tests: Adapt misc/features.py tests for ports without floating point.Daniel Campora
2015-06-24tests: Adapt basics/memoryerror.py for ports with lower heap sizes.Daniel Campora
2015-06-21tests: Add testcase for open(..., "a").Paul Sokolovsky
2015-06-20py: Use a wrapper to explicitly check self argument of builtin methods.Damien George
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.
2015-06-15tests: Check that machine module exists and print SKIP if it doesn't.Damien George
2015-06-13py: Implement divmod for mpz bignum.Damien George
2015-06-13py: Add MP_BINARY_OP_DIVMOD to simplify and consolidate divmod builtin.Damien George
2015-06-13py: Implement second arg for math.log (optional value for base).Damien George
2015-06-09py: Support unicode (utf-8 encoded) identifiers in Python source.Damien George
Enabled simply by making the identifier lexing code 8-bit clean.
2015-06-08py: Fallback to stack alloca for Python-stack if heap alloc fails.Damien George
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.
2015-06-06moductypes: Swap address and descriptor args in constructor.Paul Sokolovsky
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.
2015-06-04unix: Allow to cat a script into stdin from the command line.Damien George
See issue #1306.
2015-06-04py: Implement native multiply operation in viper emitter.Damien George
2015-06-04py: Implement implicit cast to obj for viper load/store index/value.Damien George
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.
2015-06-03tests: Add test for recursive iternext stack overflow.Damien George
2015-05-28tests: Add special tests to test mp_printf function to improve coverage.Damien George
2015-05-28tests: Add some tests for printing floats to improve coverage.Damien George
2015-05-28py: Remove unnecessary extra handling of padding of nan/inf.Damien George
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.
2015-05-28tests: Add tests to create valid and invalid UART, I2C, SPI, CAN busses.Damien George
2015-05-27unix: Add option to use uPy readline, and enable by default.Damien George
This gets uPy readline working with unix port, with tab completion and history. GNU readline is still supported, configure using MICROPY_USE_READLINE variable.
2015-05-21lib: Fix some issues in timeutilsDave Hylands
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.
2015-05-20extmod: Add ubinascii.unhexlifyDave Hylands
This also pulls out hex_digit from py/lexer.c and makes unichar_hex_digit
2015-05-17py: Implement mp_format_float for doubles and use where appropriatestijn
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.
2015-05-13py: Fix printing of complex number when imaginary part is nanstijn
2015-05-12unix: Add some extra coverage tests for vstr and attrtuple.Damien George
2015-05-12tests: Add further tests for class defining __hash__.Damien George
2015-05-12py: Convert hash API to use MP_UNARY_OP_HASH instead of ad-hoc function.Damien George
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__".
2015-05-11vm: Properly handle StopIteration raised in user instance iterator.Paul Sokolovsky
I.e. in bytecode Python functions.