Main Content

Tests in Project

Since R2025a

Metric ID

project.mt.Tests

Description

You can use this metric to count the number of tests in the current project.

The Project Model Testing dashboard uses the results from this metric in the Tests in Project widget in the Test Status section of the dashboard.

Test Status section of dashboard showing a summary of test statuses, the number of component tests, and the number of tests in the project

Supported Artifacts

You can collect this metric for the Units in your project. To control what the dashboard classifies as a unit, see Categorize Models in Hierarchy as Components or Units.

Computation Details

The metric queries the digital thread to identify the Simulink® Test™ tests in the project.

Collection

To collect data for this metric, execute the metric engine and use getMetrics with the metric ID project.mt.Tests.

metric_engine = metric.Engine;
execute(metric_engine,"project.mt.Tests");
results = getMetrics(metric_engine,"project.mt.Tests")

Collecting data for this metric loads the model file and test result files and requires a Simulink Test license.

Results

For this metric, the function getMetrics returns a metric.Result instance. Instances of metric.Result include these properties.

PropertyDescriptionData TypeExample Value
ValueNumber of tests in the projectstruct
  struct with fields:

    Count: 48
ArtifactsInformation about the tests in the projectstruct array
  1×48 struct array with fields:

    UUID
    Name
    ParentUUID
    ParentName

Compliance Thresholds

This metric does not have predefined thresholds.

See Also

| |

Topics