Main Content

Verify Code by Running Tests

In this step, you verify MATLAB® code by running tests and viewing the test results using the MATLAB Test Manager.

Open the MATLABShortestPath project.

openProject("MATLABShortestPath");

Run Tests and View Results

Open the MATLAB Test Manager.

matlabTestManager

Run all tests in the project by clicking the Run run_16.png button.

The test tDemoSmokeTest/demoShouldNotWarn fails.

Fixed Failed Test

View the failure diagnostic by clicking the hyperlink in the Diagnostic column.

failed-test-tDemo.png

Navigate to the source code that errored by clicking the first hyperlink in the failure diagnostic.

incomplete-statement.png

The statement on line 11 is incomplete. Complete the statement by adding a parenthesis, then re-run the test.

All tests pass.

See Also

Apps

Related Topics