Damien George
d792d9e49e
unix: Make extra-coverage function callable from Python scripts.
This allows the output of the extra-coverage tests to be checked using
the normal run-tests script.
10 years ago
Damien George
0589c19d52
tests: Add test for machine module (mem* functions).
10 years ago
Damien George
57ebe1b27d
unix-cpy: Fix adjustment of stack size when leaving exception handler.
Also remove __debug__ from one of the bytecode tests.
10 years ago
Damien George
9a42eb541e
py: Fix naming of function arguments when function is a closure.
Addresses issue #1226 .
10 years ago
Damien George
367d4d1098
tests: Fix cmd_showbc now that LOAD_CONST_ELLIPSIS bytecode is gone.
10 years ago
Paul Sokolovsky
37c6555b44
obj: Handle user instance hash based on Python adhoc rules.
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.
10 years ago
Paul Sokolovsky
3d3ef36e97
modstruct: Rename module to "ustruct", to allow full Python-level impl.
10 years ago
Damien George
47b9809d23
py: Check that arg to object.__new__ is a user-defined type.
Addresses issue #1203 .
10 years ago
Damien George
6bbbb1ab41
unix/modffi: Support passing float/double args.
10 years ago
Paul Sokolovsky
ae2c81ff38
vm: On exiting except block, clear sys.exc_info() value.
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.
10 years ago
Damien George
271d18eb08
py: Support conversion of bignum to bytes.
This gets int.to_bytes working for bignum, and also struct.pack with 'q'
and 'Q' args on 32-bit machines.
Addresses issue #1155 .
10 years ago
Paul Sokolovsky
8b85d14b92
modsys: Add basic sys.exc_info() implementation.
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.
10 years ago
Damien George
8c1d23a0e2
py: Modify bytecode "with" behaviour so it doesn't use any heap.
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.
10 years ago
Damien George
40d43ea88d
tests: Add more tests for viper, including tests for ViperTypeError's.
10 years ago
Damien George
1f9e2188a6
tests: Add tests for attrtuple, and for more corner cases.
10 years ago
Damien George
956d765786
py: Fix printing of "inf" and "nan" floating point values.
10 years ago
=
5008972fef
py/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
10 years ago
Damien George
d8cbbcaa9d
py: Fix builtin ord so that it can handle bytes values >= 0x80.
Addresses issue #1188 .
10 years ago
Henrik
e3cd154317
stmhal: Add support for sending and receiving CAN RTR messages.
10 years ago
Damien George
7d5e34287c
stmhal: Allow sending CAN messages with timeout=0.
Thanks to Henrik Sölver for this patch.
10 years ago
Damien George
90aa7595b4
tests: Convert line endings in fun_name.py from CRLF to LF.
10 years ago
Damien George
044c473de2
py: Add %q format support to mp_[v]printf, and use it.
10 years ago
Paul Sokolovsky
56beb01724
objarray: Support assignment of bytes to bytearray slice.
10 years ago
Paul Sokolovsky
8b7faa31e1
objstr: split(None): Fix whitespace properly.
10 years ago
Damien George
7a6dbaa89b
stmhal: Make LED object print LED(x) for consistency with constructor.
10 years ago
Damien George
9988618e0e
py: Implement full func arg passing for native emitter.
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.
10 years ago
Damien George
c9aa1883ed
py: Simplify bytecode prelude when encoding closed over variables.
10 years ago
Damien George
78772ada0d
py: Implement calling functions with *args in native emitter.
10 years ago
Damien George
e5c4362a98
tests: Add some more tests to improve code coverage of corner cases.
10 years ago
Damien George
97abe22963
tests: Add tests to exercise lexer; and some more complex number tests.
10 years ago
Damien George
9dd3640464
tests: Add missing tests for builtins, and many other things.
10 years ago
Paul Sokolovsky
620058cc57
tests: Add test for str.splitlines().
10 years ago
Damien George
82f37bf0d1
tests: Add specific test for closures in native emitter.
10 years ago
Damien George
4cd9ced8dc
py: Implement closures in native code generator.
Currently supports only x64 and Thumb2 archs.
10 years ago
Paul Sokolovsky
ad038ca101
tests/class_descriptor.py: Fix line-endings (were CRLF).
10 years ago
stijn
28fa84b445
py: Add optional support for descriptors' __get__ and __set__ methods.
Disabled by default. Enabled on unix and windows ports.
10 years ago
Damien George
23d7fd526d
tests: Skip some new tests when testing native emitter.
10 years ago
Damien George
214179b430
tests: Add tests for SyntaxError, TypeError, and other missing things.
This is intended to improve coverage of the test suite.
10 years ago
Damien George
db80b65402
tests: Make pyb/timer test check callback timing properly.
10 years ago
stijn
3cc17c69ff
py: Allow retrieving a function's __name__.
Disabled by default. Enabled on unix and stmhal ports.
10 years ago
Damien George
d478fc75b3
tests: Adjust expected output, since Travis can't do git describe.
10 years ago
Paul Sokolovsky
d48035b06b
tests: Add basic test for OrderedDict.
Mostly to have coverage of newly added code in map.c.
10 years ago
Damien George
1004535237
tests: Make cmdline tests more stable by using regex for matching.
10 years ago
Damien George
f256cfef4f
tests: Add some more tests for complex numbers and ure module.
10 years ago
Damien George
6837d46c1d
py: Fix builtin abs so it works for bools and bignum.
10 years ago
Damien George
26a9975fba
tests: Add some more tests for bytes, bignum, string and ujson.
10 years ago
Damien George
0683c1ceef
tests: Don't try to verify amount of memory used in cmd_showbc test.
10 years ago
Damien George
703c009681
tests: Add cmdline test to test showbc code.
10 years ago
Damien George
ac4f6b804f
stmhal: Fix adc.read_timed so buffer store respects element size.
Addresses issue #1154 .
10 years ago
Damien George
143c34109c
tests: Add ability to test uPy cmdline executable.
This allows to test options passed to cmdline executable, as well as the
behaviour of the REPL.
10 years ago