Main Content

Test Status Distribution Details

R2026b
Since R2026b

Metric ID

modeltesting.TestResultAnalysis[slcomp.TestStatusDistributionDetails]

Description

This metric returns detailed information about the test status of each test in the unit. For each test, the metric reports the test status and the associated test result artifact.

Use this metric to identify the status of individual tests and to trace each test to its result.

Supported Artifacts

This metric collects metric results for Units in the project. To control what the dashboard classifies as a unit, see Categorize Models in Hierarchy as Components or Units.

Collection

To collect data for this metric, execute the metric engine with the metric ID.

metric_engine = metric.Engine;
results = execute(metric_engine,"modeltesting.TestResultAnalysis[slcomp.TestStatusDistributionDetails]")

View the metric result values for a specific unit.

results(1).Value
results(1).ScopeAlias

To collect all metrics in the modeltesting.TestResultAnalysis group at once, use the group name with empty brackets. Use the MetricID property to distinguish results from different metrics in the group.

results = execute(metric_engine,"modeltesting.TestResultAnalysis[]")

Results

The metric returns an array of metric.Result objects, one for each unit in the project. Use the Value property of the metric result object to view the metric result values. Use the ScopeId and ScopeAlias properties to identify which unit the result belongs to.

The ScopeAlias property returns the name of the unit.

The Value property returns a structure array with one entry for each test in the unit. If there are no tests, the value is missing. Each structure has these fields:

  • Test — A structure identifying the test, with these fields:

    • Alias — Name of the test.

    • URI — Unique resource identifier for the test.

  • TestResult — A structure identifying the test result artifact, with these fields:

    • Alias — Name of the test result.

    • URI — Unique resource identifier for the test result.

    Empty when no test result is available for the test.

  • TestStatus — Status of the test. Values include 'Passed', 'Failed', 'Disabled', and 'Not run'.

See Also

Objects

Functions

Topics