TestReportObject

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 all

Basic Examples  (1)

Make a report for a list of tests:

Print all properties in the report:

Applications  (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)

Use the "Results" property to extract all tests as a List:

Use Part to extract only tests you are interested in:

"ResultDataset"  (1)

Use the "ResultsDataset" property to extract all tests as a Dataset:

Use Part to extract only tests you are interested in:

"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)

Use the "ResultsByTestFileName" property to return all tests grouped by file name:

"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:

The success rate excludes unevaluated tests:

Wolfram Research (2014), TestReportObject, Wolfram Language function, https://reference.wolfram.com/language/ref/TestReportObject.html (updated 2023).

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

BibTeX

@misc{reference.wolfram_2024_testreportobject, author="Wolfram Research", title="{TestReportObject}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/TestReportObject.html}", note=[Accessed: 14-July-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_testreportobject, organization={Wolfram Research}, title={TestReportObject}, year={2023}, url={https://reference.wolfram.com/language/ref/TestReportObject.html}, note=[Accessed: 14-July-2024 ]}