Find and Run Impacted Tests in Projects Under Source Control
To monitor for regressions in code functionality when you modify files in projects under source control, you can use the MATLAB Test Manager to find and run tests impacted by changes. Impacted tests are tests that depend on files that have changes after the last commit. For more information about dependency analysis, see Analyze Project Dependencies.
Enable Source Control
You can find impacted tests only when you work with projects under source control. For more information about enabling source control for Git™, Subversion® (SVN), and other tools, see Source Control Integration in MATLAB.
To track changes to your files without sharing the files with others, you can create a local Git repository that is not synced with a remote repository. For more information, see Track Work Locally with Git in MATLAB.
Alternatively, you can find tests that depend on files without enabling source control. For more information, see Find Tests That Depend on Files.
Find and Run Impacted Tests
To find impacted tests, open the MATLAB Test
Manager. In the drop-down list in the left of the menu, open the test suite
for the impacted tests by clicking Impacted Tests Since Last
Commit
.
To run the tests, click the Run button . You can collect code coverage when you run the
tests. For more information, see Collect Code Coverage.
Commit Modified Files
After you examine the test results and qualify the changes, commit the modified files.
After you commit the modified files, the Impacted Tests Since Last
Commit
test suite does not contain tests.
Commit Files by Using Git
To commit the modified files using Git, in the Project tab, in the Source Control section of the toolstrip, click Commit.
In the Commit Changes dialog box, select the files to commit, then click Commit. For more information, see Review and Commit Modified Files to Git.
Commit Files by Using SVN
To commit the modified files using SVN, in the Source Control
panel, click Commit. If the Source Control icon
is not in the sidebar, click the Open more panels
button
and select the Source
Control panel.
In the Commit Changes dialog box, select the files to commit, and then click Commit. For more information, see Work with Files Under SVN in MATLAB.