<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openmano-mpy/tests, 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>tests: Use .errno instead of .args[0] for OSError exceptions.</title>
<updated>2021-04-23T12:03:46+00:00</updated>
<author>
<name>Damien George</name>
</author>
<published>2021-04-22T09:32:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=3123f6918ba18b0a3f7a89500b450f4cb15e1aee'/>
<id>3123f6918ba18b0a3f7a89500b450f4cb15e1aee</id>
<content type='text'>
Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>py/objexcept: Support errno attribute on OSError exceptions.</title>
<updated>2021-04-23T12:03:46+00:00</updated>
<author>
<name>Damien George</name>
</author>
<published>2021-04-20T07:11:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=3c4bfd1dec28ffbefc6379dedeaa24feaa2ef373'/>
<id>3c4bfd1dec28ffbefc6379dedeaa24feaa2ef373</id>
<content type='text'>
This commit adds the errno attribute to exceptions, so code can retrieve
errno codes from an OSError using exc.errno.

The implementation here simply lets `errno` (and the existing `value`)
attributes work on any exception instance (they both alias args[0]).  This
is for efficiency and to keep code size down.  The pros and cons of this
are:

Pros:
- more compatible with CPython, less difference to document and learn
- OSError().errno will correctly return None, whereas the current way of
  doing it via OSError().args[0] will raise an IndexError
- it reduces code size on most bare-metal ports (because they already have
  the errno qstr)
- for Python code that uses exc.errno the generated bytecode is 2 bytes
  smaller and more efficient to execute (compared with exc.args[0]); so
  bytecode loaded to RAM saves 2 bytes RAM for each use of this attribute,
  and bytecode that is frozen saves 2 bytes flash/ROM for each use
- it's easier/shorter to type, and saves 2 bytes of space in .py files that
  use it (for each use)

Cons:
- increases code size by 4-8 bytes on minimal ports that don't already have
  the `errno` qstr
- all exceptions now have .errno and .value attributes (a cpydiff test is
  added to address this)

See also #2407.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit adds the errno attribute to exceptions, so code can retrieve
errno codes from an OSError using exc.errno.

The implementation here simply lets `errno` (and the existing `value`)
attributes work on any exception instance (they both alias args[0]).  This
is for efficiency and to keep code size down.  The pros and cons of this
are:

Pros:
- more compatible with CPython, less difference to document and learn
- OSError().errno will correctly return None, whereas the current way of
  doing it via OSError().args[0] will raise an IndexError
- it reduces code size on most bare-metal ports (because they already have
  the errno qstr)
- for Python code that uses exc.errno the generated bytecode is 2 bytes
  smaller and more efficient to execute (compared with exc.args[0]); so
  bytecode loaded to RAM saves 2 bytes RAM for each use of this attribute,
  and bytecode that is frozen saves 2 bytes flash/ROM for each use
- it's easier/shorter to type, and saves 2 bytes of space in .py files that
  use it (for each use)

Cons:
- increases code size by 4-8 bytes on minimal ports that don't already have
  the `errno` qstr
- all exceptions now have .errno and .value attributes (a cpydiff test is
  added to address this)

See also #2407.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tests/net_inet: Add 'Strict-Transport-Security' to exp file.</title>
<updated>2021-04-18T13:20:26+00:00</updated>
<author>
<name>Damien George</name>
</author>
<published>2021-04-18T13:20:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=7d911d20698b3b11269f34ecec97d3b4bfabac94'/>
<id>7d911d20698b3b11269f34ecec97d3b4bfabac94</id>
<content type='text'>
Because micropython.org now adds this to the headers.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Because micropython.org now adds this to the headers.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tests/feature_check: Check for lack of pass result rather than failure.</title>
<updated>2021-04-14T14:52:56+00:00</updated>
<author>
<name>Damien George</name>
</author>
<published>2021-04-14T14:47:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=8459f538eb45fd8e1e4d614298449cf18de84d75'/>
<id>8459f538eb45fd8e1e4d614298449cf18de84d75</id>
<content type='text'>
Commit cb68a5741aba5d4935428674234a9d643f97405f broke automatic Python
feature detection when running tests, because some detection relied on a
crash of a feature script returning exactly b"CRASH".

This commit fixes this and improves the situation by testing for the lack
of a known pass result, rather than an exact failure result.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit cb68a5741aba5d4935428674234a9d643f97405f broke automatic Python
feature detection when running tests, because some detection relied on a
crash of a feature script returning exactly b"CRASH".

This commit fixes this and improves the situation by testing for the lack
of a known pass result, rather than an exact failure result.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>unix: Improve command line argument processing.</title>
<updated>2021-04-07T02:41:25+00:00</updated>
<author>
<name>stijn</name>
</author>
<published>2021-04-06T18:40:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=a66286f3a0f24985cae2648102e51de64b8a1871'/>
<id>a66286f3a0f24985cae2648102e51de64b8a1871</id>
<content type='text'>
Per CPython everything which comes after the command, module or file
argument is not an option for the interpreter itself.  Hence the processing
of options should stop when encountering those, and the remainder be passed
as sys.argv.  Note the latter was already the case for a module or file but
not for a command.

This fixes issues like 'micropython myfile.py -h' showing the help and
exiting instead of passing '-h' as sys.argv[1], likewise for
'-X &lt;something&gt;' being treated as a special option no matter where it
occurs on the command line.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Per CPython everything which comes after the command, module or file
argument is not an option for the interpreter itself.  Hence the processing
of options should stop when encountering those, and the remainder be passed
as sys.argv.  Note the latter was already the case for a module or file but
not for a command.

This fixes issues like 'micropython myfile.py -h' showing the help and
exiting instead of passing '-h' as sys.argv[1], likewise for
'-X &lt;something&gt;' being treated as a special option no matter where it
occurs on the command line.
</pre>
</div>
</content>
</entry>
<entry>
<title>extmod/re1.5: Check and report byte overflow errors in _compilecode.</title>
<updated>2021-04-06T03:36:42+00:00</updated>
<author>
<name>Jeff Epler</name>
</author>
<published>2021-03-28T00:19:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=172fb5230a3943eeb6fbbb4de1dc56b16e2a7637'/>
<id>172fb5230a3943eeb6fbbb4de1dc56b16e2a7637</id>
<content type='text'>
The generated regex code is limited in the range of jumps and counts, and
this commit checks all cases which can overflow given the right kind of
input regex, and returns an error in such a case.

This change assumes that the results that overflow an int8_t do not
overflow a platform int.

Closes: #7078

Signed-off-by: Jeff Epler &lt;jepler@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The generated regex code is limited in the range of jumps and counts, and
this commit checks all cases which can overflow given the right kind of
input regex, and returns an error in such a case.

This change assumes that the results that overflow an int8_t do not
overflow a platform int.

Closes: #7078

Signed-off-by: Jeff Epler &lt;jepler@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tests/run-tests.py: Provide more info if script run via pyboard crashes.</title>
<updated>2021-03-16T03:49:57+00:00</updated>
<author>
<name>Damien George</name>
</author>
<published>2021-03-16T01:46:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=cb68a5741aba5d4935428674234a9d643f97405f'/>
<id>cb68a5741aba5d4935428674234a9d643f97405f</id>
<content type='text'>
Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tests/extmod/vfs_fat_fileio2.py: Close test file at end of test.</title>
<updated>2021-03-16T03:49:57+00:00</updated>
<author>
<name>Damien George</name>
</author>
<published>2021-03-16T01:45:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=a79d97cb76cf6ec3794c357b706dd24970317c4a'/>
<id>a79d97cb76cf6ec3794c357b706dd24970317c4a</id>
<content type='text'>
Otherwise it can lead to inconsistent results running subsequent tests.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Otherwise it can lead to inconsistent results running subsequent tests.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tests/multi_bluetooth: Skip tests when BLE features are unsupported.</title>
<updated>2021-03-12T09:08:20+00:00</updated>
<author>
<name>Damien George</name>
</author>
<published>2021-03-12T08:50:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=e98ff3f08e966595fd84d83296f84962ee3d8d94'/>
<id>e98ff3f08e966595fd84d83296f84962ee3d8d94</id>
<content type='text'>
Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tests/run-tests.py: Reformat with Black.</title>
<updated>2021-03-12T08:56:09+00:00</updated>
<author>
<name>Damien George</name>
</author>
<published>2021-03-11T05:11:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=2a38d7103672580882fb621a5b76e8d26805d593'/>
<id>2a38d7103672580882fb621a5b76e8d26805d593</id>
<content type='text'>
Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
