class
UnitTestReport
The results of a test binary's run, from Board.run_unit_tests.
from hardlabs_sdk import UnitTestReportUsage
report = board.run_unit_tests(within=120)
open("results.xml", "w").write(report.junit())
assert report.ok, report.summary()Attributes
caseslist[TestCase]- Every test the console reported, in order.
finishedbool- Whether the run's summary line (or
done) appeared. frameworkstr | Noneunityorgoogletest, from its output.
UnitTestReport.failedproperty
The tests that failed.
report.failed -> list[TestCase]UnitTestReport.okproperty
True when the run finished, ran at least one test, and none failed.
report.ok -> boolUnitTestReport.summarymethod
Returns a count of passed, failed and skipped tests, then each failure with its message.
report.summary() -> strReturns
str — The summary, for an assertion message or a log.
UnitTestReport.junitmethod
Returns the results as JUnit XML, which CI services show as test results.
report.junit(suite='on-target') -> strArguments
suitestrdefault 'on-target'- The test suite's name in the report.
Returns
str — The XML document.