Main Content

Test Case Info

Metric ID

slcomp.TestCaseInfo

Description

This metric returns meta information associated with test cases, including the test tags and the test case types. You can use this metric to help understand the categorization and types of tests for a model.

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.

Computation Details

The metric includes only test cases in the project that test the model or subsystems in the unit for which you collect metric data.

Collection

To collect data for this metric, execute the metric engine with the metric ID slcomp.TestCaseInfo. For example:

metric_engine = metric.Engine;
results = execute(metric_engine,"slcomp.TestCaseInfo")
The metric engine analyzes the available test cases and returns metric results for each test case in scope. For more information, see metric.Engine and execute.

Collecting data for this metric requires a Simulink® Test™ license.

Results

The metric returns an array of metric.Result objects, one for each test case analyzed. Each result object has these properties:

  • Value — Contains a structure with these fields:

    • Type — The type of test, returned as either 'Simulation', 'Baseline', or 'Equivalence'. For more information, see TestType (Simulink Test).

    • Tags — An array of unique tags associated with the test case. If there are no tags associated with a test, the metric returns '-'. You can add custom tags to a test case by using Test Manager.

  • Artifacts — Provides the names and unique IDs for the test case and the test file.

  • Scope — Provides the names and unique IDs for the model and the model file.

For more information, see metric.Result.

See Also

Objects

Functions

Topics