TestReport
TestReport["file"]
gives a report of the results of the tests from a file.
TestReport[{test1,test2,…}]
gives a report of the results of the testi.
TestReport[{report1,report2,…}]
gives a unified report by merging all test reports reporti.
Details and Options

- TestReport returns a TestReportObject.
- TestReport handles both plain text Wolfram Language files and notebooks that use the Testing Notebook framework.
- TestReport only runs tests with outcome "NotEvaluated", skipping ones that have already been evaluated.
- TestReport has the following options:
-
HandlerFunctions < > how to handle events generated HandlerFunctionsKeys Automatic what parameters to supply to handler functions MemoryConstraint Infinity memory (in bytes) each test is allowed to use ProgressReporting $ProgressReporting whether to report the progress SameTest SameQ function to compare actual and expected outputs TestEvaluationFunction TestEvaluate function to evaluate created tests TimeConstraint Infinity time (in seconds) each test is allowed to use - TestReport[File["file"]] is also supported.
- TestReport sets $TestFileName to the name of the file from which a test is being run.
- CreateNotebook["Testing"] opens a blank notebook set up to use the Testing Notebook framework.
Examples
open allclose allBasic Examples (2)
Run a list of TestObject:
Extract information on tests that failed and present in a TabView:
Merge the existing TestReportObject with a new one:
Scope (1)
Basic Uses (1)
Properties of the TestReportObject:
List of individual test results:
Compare the expected and actual outputs of tests where those differed:
Options (10)
HandlerFunctions (1)
Use HandlerFunctions to log test events happening during the execution of TestReport:
HandlerFunctionsKeys (1)
Use HandlerFunctionsKeys to select only the keys you are interested in when using HandlerFunctions:
If a certain event cannot provide the key you are requesting, it will not be present in the Association:
MemoryConstraint (2)
Apply a memory constraint to each test:
Options for a specific TestCreate override the options set at the TestReport level:
ProgressReporting (1)
Long test runs will automatically display a progress report:
Use the option ProgressReporting to disable it:
In order to disable the progress reporting globally, you can simply override $ProgressReporting:
SameTest (2)
Apply SameTest to all given tests:
Options for a specific TestCreate override the options set at the TestReport level:
TestEvaluationFunction (1)
TimeConstraint (2)
Apply time constraint to all given tests:
Options for a specific TestCreate override the options set at the TestReport level:
Applications (1)
Run a list of individual tests and test files at the same time:
Use TestReport again to merge an existing TestReportObject into a new one:
When merging multiple TestReportObject instances using TestReport, duplicated tests will be automatically deleted from the report:
Use the property "ResultsByTestFileName" to group together tests from the same file:
Properties & Relations (2)
Use Throw and Catch in HandlerFunctions to stop the execution of the test run when a test fails:
You can also use Throw and Catch in TestEvaluationFunction:
Use Reap and Sow in HandlerFunctions to collect all event names:
Possible Issues (1)
A TestReport with no tests is considered a success:
Text
Wolfram Research (2014), TestReport, Wolfram Language function, https://reference.wolfram.com/language/ref/TestReport.html (updated 2023).
CMS
Wolfram Language. 2014. "TestReport." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/TestReport.html.
APA
Wolfram Language. (2014). TestReport. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TestReport.html