Main Content

Simulink.SubsystemReference.getUnitTestNames

Return names of unit tests of subsystem file

Since R2023a

Description

example

unitTests = Simulink.SubsystemReference.getUnitTestNames(SSRefName) returns the names of the test harnesses that are selected as unit tests of the subsystem file SSRefName.

Examples

collapse all

Get unit tests of the subsystem file slexReusableSS.

ssfile = "slexReusableSS";
open_system(ssfile);

Set the test harnesses ssref1_double and ssref1_int32 as unit tests of the subsystem file.

set_param(ssfile,"UnitTestNames",{'ssref1_double','ssref1_int32'});
save_system(ssfile);

Get names of unit tests.

unitTests = Simulink.SubsystemReference.getUnitTestNames(ssfile)
unitTests = 1x2 cell
    {'ssref1_double'}    {'ssref1_int32'}

Input Arguments

collapse all

Name of the subsystem file, specified as a string scalar or character vector. You can also specify the handle of the subsystem file.

Example: "slexReusableSS"

Data Types: string | char

Output Arguments

collapse all

Names of unit tests of the subsystem file, specified as a cell array.

Data Types: cell

Version History

Introduced in R2023a