Contenuto principale

addTestFolders

R2026b

Add folder to project test folders

Since R2026b

Description

addTestFolders(proj,folders) adds the folders specified in folders as test folders of the project. The project uses test folders to identify and run tests in the project. The folders must be in the project root folder.

example

Examples

collapse all

Open the Times Table App project. Use currentProject to create a project object from the currently loaded project.

openExample("matlab/TimesTableProjectExample")
proj = currentProject;

Create a new folder.

 newtestfolder = fullfile(proj.RootFolder,"newtestfolder");
 mkdir(newtestfolder);

Add the new folder to the project.

 addFile(proj,newtestfolder);

Then, add the new folder to the project test folders.

addTestFolders(proj,newtestfolder);

Input Arguments

collapse all

Project, specified as a matlab.project.Project object. Use currentProject to create a project object from the currently loaded project.

Path of the folders to add to the project test folders, specified as string array or as a cell array of character vectors. The folders must be within the root folder.

Version History

Introduced in R2026b