Wolfram Research

Function Repository Resource:

TestReportNotebook

Source Notebook

Expand a TestReport into a notebook

Contributed by: Riccardo Di Virgilio  |  riccardodi-virgilio

ResourceFunction["TestReportNotebook"][{test1,test2,}]

gives a report of the results of the verification tests testi.

ResourceFunction["TestReportNotebook"]["file"]

runs tests from a file, returning an analysis of the completed test run.

ResourceFunction["TestReportNotebook"][TestReport[]]

gives a report of an already computed test result.

Details

ResourceFunction["TestReportNotebook"] returns a TestReportObject.
If the TestReportObject contains failed tests the failures will be included in the opened notebook.
You can provide a mixed list of TestResultObject, TestReportObject or File in order to create a unique test report notebook.

Examples

Basic Examples (1) 

Run a test suite and open a notebook with the results:

In[1]:=
ResourceFunction["TestReportNotebook"][{
  VerificationTest[Sin[E] > Cos[E]],
  VerificationTest[MatrixQ[{{1, 2, 3}, {4, 5, 6, 7}}]],
  VerificationTest[1/0, ComplexInfinity]
  }]
Out[1]=

Scope (2) 

Run tests from a notebook:

In[2]:=
ResourceFunction["TestReportNotebook"][
 FileNameJoin[{"ExampleData", "ExampleTestFile.nb"}]]
Out[2]=

You can provide a mixed list of TestResultObject, TestReportObject or File in order to create a unique test report notebook:

In[3]:=
ResourceFunction["TestReportNotebook"][{
  File[FileNameJoin[{"ExampleData", "ExampleTestFile.nb"}]],
  VerificationTest[Sin[E] > Cos[E]],
  VerificationTest[MatrixQ[{{1, 2, 3}, {4, 5, 6, 7}}]],
  TestReport[{VerificationTest[1, 1], VerificationTest[2 + 2, 3]}]
  }]
Out[3]=

Resource History

Related Resources

License Information