主要内容

sltest.stmv2.migrate.importProject

R2026b

Convert MLDATX test files in MATLAB project into SLTEST files (Tech Preview)

Since R2026b

    Description

    Note

    The redesigned Simulink® Test Manager is a tech preview in R2026b. The primary purpose of the tech preview is to provide early access to the most common testing workflows. For more information about supported workflows, see Overview of the Redesigned Simulink Test Manager (Tech Preview).

    To enable the feature, click the New Test Manager button in the existing Test Manager or use the sltest.stmv2.open function at the command line.

    report = sltest.stmv2.migrate.importProject(projectPath) searches the MATLAB® project at the file path projectPath for MLDATX test files, converts them into SLTEST files to use in the redesigned Test Manager, and returns a report table with one row for each SLTEST file.

    example

    report = sltest.stmv2.migrate.importProject(___,Name=Value) specifies additional options using one or more name-value arguments.

    example

    Examples

    collapse all

    Import all MLDATX test files in a MATLAB project for use in the redesigned Test Manager.

    report = sltest.stmv2.migrate.importProject("C:\myProject\tests");

    Import the MLDATX test files in a project to a specific folder, specify the file name, and enable file overwriting.

    report = sltest.stmv2.migrate.importProject("C:\myProject\tests",...
        OutputDir="imported/tests",...
        Postfix="_imported",...
        Overwrite=true);

    Input Arguments

    collapse all

    Project path to search for MLDATX files, specified as a string scalar. or character vector

    Data Types: string | char

    Name-Value Arguments

    collapse all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: sltest.stmv2.migrate.importProject(projectName,Overwrite=true)

    Option to overwrite the existing SLTEST files in the folder where the function generates the SLTEST files, specified as true or false. If you specify this argument as false, the function appends a numeric suffix to the generated SLTEST files names to avoid file name conflicts.

    Data Types: logical

    Folder in which to save the SLTEST files, specified as a string scalar. If you do not specify this argument, the function saves the SLTEST files in a folder named stmv2 in the same folder as the MLDATX source file.

    Data Types: string

    Prefix to add to the SLTEST file name, specified as a string scalar.

    Data Types: string

    Postfix to add to the SLTEST file name, specified as a string scalar.

    Data Types: string

    Option to create run settings files, specified as true or false.

    Data Types: logical

    Option to create runlist files, specified as true or false.

    Data Types: logical

    Option to import the MLDATX test files in referenced projects, specified as true or false.

    Data Types: logical

    Output Arguments

    collapse all

    Import report, returned as a table . The table has one row for each SLTEST file, and contains these columns:

    Column NameDescription
    Project Name of the MATLAB project.
    SourceFileFull path to the MLDATX file.
    OutputFileFull path to the SLTEST file. If the function does not import the file, the value of OutputFile is "".
    StatusStatus of the import, specified as "Imported", "Skipped", or "Failed".
    RunSettingsFilePath to the run settings file. If you do not generate a run settings file, the value of RunSettingsFile is "".
    RunlistFilePath to the runlist file. If you do not generate a runlist, the value of RunlistFile is "".
    MessageWarnings or error messages.

    Data Types: table

    Version History

    Introduced in R2026b