Unity: show test case status before stdout

This commit is contained in:
Ivan Kravets
2022-04-24 11:28:07 +03:00
parent c9026a1b9c
commit 8b694f3734
2 changed files with 5 additions and 6 deletions

View File

@ -44,8 +44,9 @@ Please check `Migration guide from 5.x to 6.0 <https://docs.platformio.org/en/la
* **Unit Testing**
- Generate reports in JUnit and JSON formats using the `pio test --output-format <https://docs.platformio.org/en/latest/core/userguide/cmd_test.html#cmdoption-pio-test-output-format>`__ option (`issue #2891 <https://github.com/platformio/platformio-core/issues/2891>`_)
- Added a new "test" `build configuration <https://docs.platformio.org/en/latest/projectconf/build_configurations.html>`__
- Added support for test hierarchies (nested test suites) (`issue #4135 <https://github.com/platformio/platformio-core/issues/4135>`_)
- Generate reports in JUnit and JSON formats using the `pio test --output-format <https://docs.platformio.org/en/latest/core/userguide/cmd_test.html#cmdoption-pio-test-output-format>`__ option (`issue #2891 <https://github.com/platformio/platformio-core/issues/2891>`_)
- Provide more information when the native program crashed on a host (errored with a negative return code) (`issue #3429 <https://github.com/platformio/platformio-core/issues/3429>`_)
- Fixed an issue when command line parameters ("--ignore", "--filter") do not override values defined in the |PIOCONF| (`issue #3845 <https://github.com/platformio/platformio-core/issues/3845>`_)

View File

@ -249,13 +249,11 @@ void unityOutputComplete(void) { unittest_uart_end(); }
for line in data.strip().split("\n"):
line = line.strip()
if line.endswith(":PASS"):
click.echo("%s\t[%s]" % (line[:-5], click.style("PASSED", fg="green")))
click.echo("[%s] %s" % (click.style("PASSED", fg="green"), line[:-5]))
elif line.endswith(":IGNORE"):
click.echo(
"%s\t[%s]" % (line[:-7], click.style("IGNORED", fg="yellow"))
)
click.echo("[%s] %s" % (click.style("IGNORED", fg="yellow"), line[:-7]))
elif ":FAIL" in line:
click.echo("%s\t[%s]" % (line, click.style("FAILED", fg="red")))
click.echo("[%s] %s" % (click.style("FAILED", fg="red"), line))
else:
click.echo(line)