Generate report file that contains metric results
Analyze the requirements-based testing artifacts in a project and generate a report file that contains the results.
Open the project that you want to analyze. For this example, open the project by
using the command
metric.Engine object for the project.
metric_engine = metric.Engine;
Update the trace information for
metric_engine to reflect
any pending artifact changes and
ensure that all test
results are tracked.
Create a list of the available metric identifiers.
metric_ids = getAvailableMetricIds(metric_engine);
Collect results by executing the metric engine on the list of metric identifiers.
Generate an HTML report named
metricResultsReport in the current
directory, which is the root folder of the project.
reportLocation = fullfile(pwd, 'metricResultsReport.html'); generateReport(metric_engine,'Type','html-file','Location',reportLocation);
Open the HTML report from the root folder of the project. To open the table of contents and navigate to results for each unit, click the menu icon in the top-left corner of the report. For each unit in the report, there is an artifact summary table that displays the number of artifacts in the requirements, design, and tests.
metricEngine— Metric engine object
Metric engine object for which you collected metric results, specified as a
comma-separated pairs of
the argument name and
Value is the corresponding value.
Name must appear inside quotes. You can specify several name and value
pair arguments in any order as
Type— File type
File type for the generated report, specified as
Location— Full file name
Full file name for the generated report, specified as a character vector or string
scalar. Use the location to specify the name of the report. By default, the report is
reportFile— Full file name of report
Full file name of the generated report, returned as a character vector.