TestReportObject
gives an object that represents the results of TestReport.
Details
- TestReportObject is typically obtained as a result from TestReport.
- TestReportObject[…]["prop"] returns the value of "prop" for a given TestReportObject.
- TestReportObject[…][{"prop1","prop2",…}] returns an association of values corresponding to several properties.
- TestReportObject[…]["Properties"] returns a list of all properties available.
- Possible properties for TestReportObject include:
-
"Results" all test results as a List "ResultsDataset" all test results as a Dataset "ResultsByOutcome" test results grouped by "Outcome" property "ResultsByTestFileName" test results grouped by "TestFileName" property "ResultsByTestID" test results grouped by "TestID" property "RuntimeFailures" non-test failures generated during the test run "ReportSucceeded" whether all tests succeeded without emitting failures "MemoryUsed" number of bytes used to store all data "CPUTimeUsed" CPU time spent on evaluating tests "AbsoluteTimeUsed" absolute number of seconds in real time that have elapsed "Title" title of the test file
Examples
open allclose allApplications (1)
Create a TestReportObject:
Use the "TestCreate" property on every test in the report:
Use ReleaseHold to run the test suite again:
Use Export to save the test suite as a file:
Use TestReport to run the exported test suite again:
Properties & Relations (10)
Properties (10)
"ResultList" (1)
"ResultDataset" (1)
"ResultsByOutcome" (1)
Use the "ResultsByOutcome" property to get a grouped list of tests:
Use Part to extract only tests you are interested in:
"ResultsByTestFileName" (1)
"ResultsByTestID" (1)
Use the "ResultsByTestID" property to return all tests grouped by test ID:
Use Part syntax to extract only tests you are interested in:
Use TestEvaluate to run the tests again:
"RuntimeFailures" (1)
A defective TestReport might emit some failures at runtime:
Use the "RuntimeFailures" property to display all error events as Failure objects:
"ReportSucceeded" (4)
The "ReportSucceeded" property will return True if and only if all the tests succeeded and none emitted runtime failures:
A report with any test that resulted in an "Outcome" different from "Succeeded" will return False:
A report with one or more "RuntimeFailures" in it will always return False, even if all tests succeeded:
Text
Wolfram Research (2014), TestReportObject, Wolfram Language function, https://reference.wolfram.com/language/ref/TestReportObject.html (updated 2023).
CMS
Wolfram Language. 2014. "TestReportObject." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/TestReportObject.html.
APA
Wolfram Language. (2014). TestReportObject. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TestReportObject.html