aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
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.
2015-05-11sthmal/rtc.c: Add calibration() method to get/set RTC fine-tuning value.blmorris
2015-05-10py: iternext() may not return MP_OBJ_NULL, only MP_OBJ_STOP_ITERATION.Paul Sokolovsky
Testing for incorrect value led to premature termination of generator containing yield from for such iterator (e.g. "yield from [1, 2]").
2015-05-08unix: Make extra-coverage function callable from Python scripts.Damien George
This allows the output of the extra-coverage tests to be checked using the normal run-tests script.
2015-05-08tests: Add test for machine module (mem* functions).Damien George
2015-05-06unix-cpy: Fix adjustment of stack size when leaving exception handler.Damien George
Also remove __debug__ from one of the bytecode tests.
2015-05-06py: Fix naming of function arguments when function is a closure.Damien George
Addresses issue #1226.
2015-05-05tests: Fix cmd_showbc now that LOAD_CONST_ELLIPSIS bytecode is gone.Damien George
2015-05-05obj: Handle user instance hash based on Python adhoc rules.Paul Sokolovsky
User instances are hashable by default (using __hash__ inherited from "object"). But if __eq__ is defined and __hash__ not defined in particular class, instance is not hashable.
2015-05-04modstruct: Rename module to "ustruct", to allow full Python-level impl.Paul Sokolovsky
2015-05-04py: Check that arg to object.__new__ is a user-defined type.Damien George
Addresses issue #1203.
2015-04-28unix/modffi: Support passing float/double args.Damien George
2015-04-26vm: On exiting except block, clear sys.exc_info() value.Paul Sokolovsky
This doesn't handle case fo enclosed except blocks, but once again, sys.exc_info() support is a workaround for software which uses it instead of properly catching exceptions via variable in except clause.
2015-04-25py: Support conversion of bignum to bytes.Damien George
This gets int.to_bytes working for bignum, and also struct.pack with 'q' and 'Q' args on 32-bit machines. Addresses issue #1155.
2015-04-25modsys: Add basic sys.exc_info() implementation.Paul Sokolovsky
The implementation is very basic and non-compliant and provided solely for CPython compatibility. The function itself is bad Python2 heritage, its usage is discouraged.
2015-04-24py: Modify bytecode "with" behaviour so it doesn't use any heap.Damien George
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.
2015-04-22tests: Add more tests for viper, including tests for ViperTypeError's.Damien George
2015-04-22tests: Add tests for attrtuple, and for more corner cases.Damien George
2015-04-22py: Fix printing of "inf" and "nan" floating point values.Damien George
2015-04-19py/inlinethumb: Support for core floating point instructions.=
Adds support for the following Thumb2 VFP instructions, via the option MICROPY_EMIT_INLINE_THUMB_FLOAT: vcmp vsqrt vneg vcvt_f32_to_s32 vcvt_s32_to_f32 vmrs vmov vldr vstr vadd vsub vmul vdiv
2015-04-19py: Fix builtin ord so that it can handle bytes values >= 0x80.Damien George
Addresses issue #1188.
2015-04-18stmhal: Add support for sending and receiving CAN RTR messages.Henrik
2015-04-16stmhal: Allow sending CAN messages with timeout=0.Damien George
Thanks to Henrik Sölver for this patch.
2015-04-16tests: Convert line endings in fun_name.py from CRLF to LF.Damien George
2015-04-16py: Add %q format support to mp_[v]printf, and use it.Damien George
2015-04-16objarray: Support assignment of bytes to bytearray slice.Paul Sokolovsky
2015-04-12objstr: split(None): Fix whitespace properly.Paul Sokolovsky
2015-04-11stmhal: Make LED object print LED(x) for consistency with constructor.Damien George
2015-04-07py: Implement full func arg passing for native emitter.Damien George
This patch gets full function argument passing working with native emitter. Includes named args, keyword args, default args, var args and var keyword args. Fully Python compliant. It reuses the bytecode mp_setup_code_state function to do all the hard work. This function is slightly adjusted to accommodate native calls, and the native emitter is forced a bit to emit similar prelude and code-info as bytecode.
2015-04-07py: Simplify bytecode prelude when encoding closed over variables.Damien George
2015-04-06py: Implement calling functions with *args in native emitter.Damien George
2015-04-05tests: Add some more tests to improve code coverage of corner cases.Damien George
2015-04-04tests: Add tests to exercise lexer; and some more complex number tests.Damien George
2015-04-04tests: Add missing tests for builtins, and many other things.Damien George
2015-04-04tests: Add test for str.splitlines().Paul Sokolovsky
2015-04-03tests: Add specific test for closures in native emitter.Damien George
2015-04-03py: Implement closures in native code generator.Damien George
Currently supports only x64 and Thumb2 archs.
2015-03-28tests/class_descriptor.py: Fix line-endings (were CRLF).Paul Sokolovsky