TestResultObject

TestResultObject is being phased out in favor of TestObject, which was introduced in Version 13.3.

TestResultObject[]

gives an object that represents the results of a VerificationTest.

Details

  • TestResultObject is typically obtained as a result from VerificationTest.
  • TestResultObject[]["prop"] returns the value of "prop" for a given TestResultObject.
  • TestResultObject[][{"prop1","prop2",}] returns an association of values corresponding to several properties.
  • TestResultObject[]["Properties"] returns a list of all properties available.
  • Possible properties for TestResultObject include:
  • "AbsoluteTime"absolute time the test was created, in UTC time zone
    "AbsoluteTimeUsed"absolute number of seconds in real time that have elapsed
    "ActualMessages"messages generated on evaluating input
    "ActualOutput"output generated on evaluating input
    "CPUTimeUsed"CPU time spent on evaluating input
    "Created"DateObject of creation time, in $TimeZone
    "ExpectedMessages"messages passed to the test
    "ExpectedOutput"evaluated expected output
    "Input"original test input
    "MemoryConstraint"original MemoryConstraint value
    "MemoryUsed"number of bytes used to store all data
    "Outcome"outcome on running the VerificationTest
    "SameTest"original SameTest function
    "TestFileName"absolute file name of the currently executing test file
    "TestID"unique identifier for the test
    "TestKey"automatic key that is unique for every test
    "TimeConstraint"original TimeConstraint value
    "VerificationTest"original VerificationTest expression

Examples

open allclose all

Basic Examples  (2)

Run a VerificationTest to get a TestResultObject:

Extract output generated on evaluation of input:

Extract the original input and run the test again by using ReleaseHold:

Scope  (1)

List of all properties:

Extract several properties at once:

Extract all properties and present results in a Dataset:

Applications  (1)

Evaluate a test:

Use the "VerificationTest" property to recreate the original test expression:

Use ReleaseHold to run it again:

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

Text

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

CMS

Wolfram Language. 2014. "TestResultObject." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TestResultObject.html.

APA

Wolfram Language. (2014). TestResultObject. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TestResultObject.html

BibTeX

@misc{reference.wolfram_2023_testresultobject, author="Wolfram Research", title="{TestResultObject}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/TestResultObject.html}", note=[Accessed: 19-April-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_testresultobject, organization={Wolfram Research}, title={TestResultObject}, year={2014}, url={https://reference.wolfram.com/language/ref/TestResultObject.html}, note=[Accessed: 19-April-2024 ]}