Main Content

Simulink.SubsystemReference.getUnitTestNames

Return names of unit tests of subsystem file

Since R2023a

Description

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

example

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

Path or handle of a subsystem file, specified as a string scalar or character vector.

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