Main Content

Generating a Test Results Report

This example shows how to generate a test results report from the Test Manager using a baseline test case. The model used for this example is sltestTestManagerReportsExample.

Load and run the test file

Load and run the test file programmatically. The test file contains a baseline test case.

exampleFile = 'sltestTestManagerReportsTestSuite.mldatx';
sltest.testmanager.load(exampleFile);
baselineObj = sltest.testmanager.run;

Generate the report

You can generate the test results report programmatically or by using the Test Manager interface.

To generate the report programmatically:

Generate a report of the test case results using the results set object. The report is saved as a ZIP and shows all the test results. The report opens when it is completed.

sltest.testmanager.report(baselineObj,'baselineReport.zip',...
    'IncludeTestResults',0,'IncludeComparisonSignalPlots',true,...
    'IncludeSimulationSignalPlots',true,'NumPlotRowsPerPage',3);

The report.html file is stored in the baselineReport.zip folder.

Alternatively, to generate the report using the Test Manager:

1. Open the Test Manager using sltest.testmanager.view.

2. In the Test Browser pane, select the Test Suite and click Run.

3. After the test runs, in the Results and Artifacts pane, select Results.

4. In the toolstrip, click Report.

5. In the Create Test Result Report dialog box, select the items to include in the report and click Create.

To customize the report, see Customize Test Results Reports.

sltest.testmanager.clear;

See Also

Topics