diff --git a/HISTORY.rst b/HISTORY.rst index 58613cf6..14fb0147 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -23,6 +23,7 @@ PlatformIO Core 5 - Dropped support for "pythonPackages" field in "platform.json" manifest in favor of `Extra Python Dependencies `__ * Improved PIO Remote setup on credit-card sized computers (Raspberry Pi, BeagleBon, etc) (`issue #3865 `_) +* Better handling of the failed tests using `Unit Testing `__ solution 5.2.5 (2022-02-10) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/commands/test/processor.py b/platformio/commands/test/processor.py index 0e1e367f..af05e825 100644 --- a/platformio/commands/test/processor.py +++ b/platformio/commands/test/processor.py @@ -13,6 +13,7 @@ # limitations under the License. import atexit +import re from os import listdir, remove from os.path import isdir, isfile, join from string import Template @@ -163,6 +164,10 @@ class TestProcessorBase(object): self._run_failed = True click.echo("%s\t[%s]" % (line, click.style("FAILED", fg="red"))) 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) def generate_output_file(self, test_dir):