Better handling of the failed tests using "Unit Testing" solution

This commit is contained in:
Ivan Kravets
2022-02-22 13:02:10 +02:00
parent dbe3ab6c97
commit 22a037b213
2 changed files with 6 additions and 0 deletions

View File

@ -23,6 +23,7 @@ PlatformIO Core 5
- Dropped support for "pythonPackages" field in "platform.json" manifest in favor of `Extra Python Dependencies <https://docs.platformio.org/en/latest/scripting/examples/extra_python_packages.html>`__ - Dropped support for "pythonPackages" field in "platform.json" manifest in favor of `Extra Python Dependencies <https://docs.platformio.org/en/latest/scripting/examples/extra_python_packages.html>`__
* Improved PIO Remote setup on credit-card sized computers (Raspberry Pi, BeagleBon, etc) (`issue #3865 <https://github.com/platformio/platformio-core/issues/3865>`_) * Improved PIO Remote setup on credit-card sized computers (Raspberry Pi, BeagleBon, etc) (`issue #3865 <https://github.com/platformio/platformio-core/issues/3865>`_)
* Better handling of the failed tests using `Unit Testing <https://docs.platformio.org/en/latest/plus/unit-testing.html>`__ solution
5.2.5 (2022-02-10) 5.2.5 (2022-02-10)
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~

View File

@ -13,6 +13,7 @@
# limitations under the License. # limitations under the License.
import atexit import atexit
import re
from os import listdir, remove from os import listdir, remove
from os.path import isdir, isfile, join from os.path import isdir, isfile, join
from string import Template from string import Template
@ -163,6 +164,10 @@ class TestProcessorBase(object):
self._run_failed = True self._run_failed = True
click.echo("%s\t[%s]" % (line, click.style("FAILED", fg="red"))) click.echo("%s\t[%s]" % (line, click.style("FAILED", fg="red")))
else: else:
if "Failures" in line:
match = re.match(r"\d+\s+Tests\s+(\d+)\s+Failures", line)
if match and int(match.group(1)) > 0:
self._run_failed = True
click.echo(line) click.echo(line)
def generate_output_file(self, test_dir): def generate_output_file(self, test_dir):