<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openmano-mpy/tests/unix, branch master</title>
<subtitle>MicroPython source and hardware configuration for OpenMano</subtitle>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/'/>
<entry>
<title>py/mpprint: Fix length calculation for strings with precision-modifier.</title>
<updated>2020-12-07T12:32:06+00:00</updated>
<author>
<name>Joris Peeraer</name>
</author>
<published>2020-10-22T08:38:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=5020b14d5419065f1a5ef5aed1be7badee28c9bf'/>
<id>5020b14d5419065f1a5ef5aed1be7badee28c9bf</id>
<content type='text'>
Two issues are tackled:

1. The calculation of the correct length to print is fixed to treat the
   precision as a maximum length instead as the exact length.
   This is done for both qstr (%q) and for regular str (%s).

2. Fix the incorrect use of mp_printf("%.*s") to mp_print_strn().

   Because of the fix of above issue, some testcases that would print
   an embedded null-byte (^@ in test-output) would now fail.
   The bug here is that "%s" was used to print null-bytes. Instead,
   mp_print_strn is used to make sure all bytes are outputted and the
   exact length is respected.

Test-cases are added for both %s and %q with a combination of precision
and padding specifiers.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Two issues are tackled:

1. The calculation of the correct length to print is fixed to treat the
   precision as a maximum length instead as the exact length.
   This is done for both qstr (%q) and for regular str (%s).

2. Fix the incorrect use of mp_printf("%.*s") to mp_print_strn().

   Because of the fix of above issue, some testcases that would print
   an embedded null-byte (^@ in test-output) would now fail.
   The bug here is that "%s" was used to print null-bytes. Instead,
   mp_print_strn is used to make sure all bytes are outputted and the
   exact length is respected.

Test-cases are added for both %s and %q with a combination of precision
and padding specifiers.
</pre>
</div>
</content>
</entry>
<entry>
<title>examples: Add example code for user C modules, both C and C++.</title>
<updated>2020-10-29T04:30:42+00:00</updated>
<author>
<name>stijn</name>
</author>
<published>2020-10-21T09:13:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=25c4563f26c2270cde01b01dca0e8b801c9c8282'/>
<id>25c4563f26c2270cde01b01dca0e8b801c9c8282</id>
<content type='text'>
Add working example code to provide a starting point for users with files
that they can just copy, and include the modules in the coverage test to
verify the complete user C module build functionality.  The cexample module
uses the code originally found in cmodules.rst, which has been updated to
reflect this and partially rewritten with more complete information.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add working example code to provide a starting point for users with files
that they can just copy, and include the modules in the coverage test to
verify the complete user C module build functionality.  The cexample module
uses the code originally found in cmodules.rst, which has been updated to
reflect this and partially rewritten with more complete information.
</pre>
</div>
</content>
</entry>
<entry>
<title>esp32,unix: Support building C++ code.</title>
<updated>2020-10-29T04:29:50+00:00</updated>
<author>
<name>stijn</name>
</author>
<published>2020-10-08T14:52:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=fad4079778f46bc21dd19a674b31b4c3c7eb6a91'/>
<id>fad4079778f46bc21dd19a674b31b4c3c7eb6a91</id>
<content type='text'>
Support building .cpp files and linking them into the micropython
executable in a way similar to how it is done for .c files.  The main
incentive here is to enable user C modules to use C++ files (which are put
in SRC_MOD_CXX by py.mk) since the core itself does not utilize C++.

However, to verify build functionality a unix overage test is added.  The
esp32 port already has CXXFLAGS so just add the user modules' flags to it.
For the unix port use a copy of the CFLAGS but strip the ones which are not
usable for C++.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Support building .cpp files and linking them into the micropython
executable in a way similar to how it is done for .c files.  The main
incentive here is to enable user C modules to use C++ files (which are put
in SRC_MOD_CXX by py.mk) since the core itself does not utilize C++.

However, to verify build functionality a unix overage test is added.  The
esp32 port already has CXXFLAGS so just add the user modules' flags to it.
For the unix port use a copy of the CFLAGS but strip the ones which are not
usable for C++.
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: Format all Python code with black, except tests in basics subdir.</title>
<updated>2020-03-30T02:21:58+00:00</updated>
<author>
<name>David Lechner</name>
</author>
<published>2020-03-23T02:26:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=3dc324d3f1312e40d3a8ed87e7244966bb756f26'/>
<id>3dc324d3f1312e40d3a8ed87e7244966bb756f26</id>
<content type='text'>
This adds the Python files in the tests/ directory to be formatted with
./tools/codeformat.py.  The basics/ subdirectory is excluded for now so we
aren't changing too much at once.

In a few places `# fmt: off`/`# fmt: on` was used where the code had
special formatting for readability or where the test was actually testing
the specific formatting.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds the Python files in the tests/ directory to be formatted with
./tools/codeformat.py.  The basics/ subdirectory is excluded for now so we
aren't changing too much at once.

In a few places `# fmt: off`/`# fmt: on` was used where the code had
special formatting for readability or where the test was actually testing
the specific formatting.
</pre>
</div>
</content>
</entry>
<entry>
<title>tests/unix: Add coverage tests for kbd-intr and scheduler.</title>
<updated>2020-02-07T05:08:29+00:00</updated>
<author>
<name>Damien George</name>
</author>
<published>2020-02-06T09:26:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=eaf30c516af87104b7fbba7fcd557d097a4951f9'/>
<id>eaf30c516af87104b7fbba7fcd557d097a4951f9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>tests/unix: Add coverage tests for mp_obj_is_type() and variants.</title>
<updated>2020-01-23T23:57:17+00:00</updated>
<author>
<name>Yonatan Goldschmidt</name>
</author>
<published>2020-01-22T19:44:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=35e664d7790b123dab54faff766f41991f4620d1'/>
<id>35e664d7790b123dab54faff766f41991f4620d1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>tests/unix: Add coverage test for mp_obj_new_exception_args.</title>
<updated>2020-01-23T02:37:25+00:00</updated>
<author>
<name>Damien George</name>
</author>
<published>2020-01-23T02:18:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=27f41e624c39f661f917c20b58daf6637ada0982'/>
<id>27f41e624c39f661f917c20b58daf6637ada0982</id>
<content type='text'>
Because it's no longer called anywhere in the code.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Because it's no longer called anywhere in the code.
</pre>
</div>
</content>
</entry>
<entry>
<title>tests/unix: Add coverage tests for pairheap data structure.</title>
<updated>2020-01-22T06:31:18+00:00</updated>
<author>
<name>Damien George</name>
</author>
<published>2020-01-13T13:02:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=dccace6f3fdded89dbf8173eb3882205c419f2fb'/>
<id>dccace6f3fdded89dbf8173eb3882205c419f2fb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>tests/unix: Add coverage test for new mp_obj_int_get_uint_checked func.</title>
<updated>2020-01-14T12:45:56+00:00</updated>
<author>
<name>Damien George</name>
</author>
<published>2020-01-14T12:45:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=3448e69c2d6f6f066907005f56bbd26fffb756e9'/>
<id>3448e69c2d6f6f066907005f56bbd26fffb756e9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>tests/unix: Make unix time test pass on more platforms.</title>
<updated>2020-01-06T12:28:42+00:00</updated>
<author>
<name>stijn</name>
</author>
<published>2020-01-06T11:36:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=54a2584de10103ba3e559de1034cc76962ec681e'/>
<id>54a2584de10103ba3e559de1034cc76962ec681e</id>
<content type='text'>
As the mktime documentation for CPython states: "The earliest date for
which it can generate a time is platform-dependent".  In particular on
Windows this depends on the timezone so e.g. for UTC+2 the earliest is 2
hours past midnight January 1970.  So change the reference to the earliest
possible, for UTC+14.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As the mktime documentation for CPython states: "The earliest date for
which it can generate a time is platform-dependent".  In particular on
Windows this depends on the timezone so e.g. for UTC+2 the earliest is 2
hours past midnight January 1970.  So change the reference to the earliest
possible, for UTC+14.
</pre>
</div>
</content>
</entry>
</feed>
