主要内容

sltest.stmv2.migrate.importFile

R2026b

Convert MLDATX test file into SLTEST file (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.

    importedFiles = sltest.stmv2.migrate.importFile(mldatxPath) imports the MLDATX test file, mldatxPath, converts the file into SLTEST files for use in the redesigned Test Manager, saves the SLTEST files in the same folder as the MLDATX file, and returns SLTEST file paths. If the MLDATX test file contains test cases for multiple models, the function creates one SLTEST file for each model.

    example

    importedFiles = sltest.stmv2.migrate.importFile(mldatxPath,importFolder) saves the SLTEST files in the folder importFolder.

    example

    importedFiles = sltest.stmv2.migrate.importFile(mldatxPath,importFolder,fileName) saves the SLTEST file with the file name fileName.

    example

    importedFiles = sltest.stmv2.migrate.importFile(___,CreateRunSettings=true) imports the MLDATX test file and creates a default run settings file and runlist.

    example

    Examples

    collapse all

    Import an MLDATX test file and save the SLTEST files in the same folder.

    importedFiles = sltest.stmv2.migrate.importFile("C:\myTests\test.mldatx");

    Import an MLDATX test file and save the SLTEST files to a specified folder.

    importedFiles = sltest.stmv2.migrate.importFile( ...
        "C:\myTests\test.mldatx","C:\output");

    Import an MLDATX test file and specify a name for the SLTEST file.

    importedFiles = sltest.stmv2.migrate.importFile( ...
        "C:\tests\myTest.mldatx","C:\output","migrated.sltest");

    Import an MLDATX test file and create a default run settings file and a runlist.

    importedFiles = sltest.stmv2.migrate.importFile( ...
        "C:\tests\test.mldatx",CreateRunSettings=true);

    Input Arguments

    collapse all

    Path to the MLDATX test file to import and convert, specified as a string scalar or character vector.

    Data Types: string | char

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

    Data Types: string | cghar

    Name for SLTEST file, specified as a string scalar or character vector. If the source MLDATX file contains test cases for multiple models, the function appends the model name to the file name that you specify. For example, for a test case named mytest that tests the model modelA, the SLTEST file name is "mytest_modelA.sltest".

    Data Types: string | char

    Output Arguments

    collapse all

    Paths to the imported files, returned as a string array. The array includes the SLTEST files. If you use the importedFiles = sltest.stmv2.migrate.importFile(___,CreateRunSettings=true) syntax, the output array also includes SLTESTR run settings file and SLTESTRL runlist file paths.

    Data Types: string

    Version History

    Introduced in R2026b