MATLAB: I am using the test manager to run the tests in a model. In the Test Sequence editor I make a call to the following code as the last step. coder.extr​insic(‘bdr​oot’); coder.extr​insic(‘set​_param’); set_param(bdroot, ‘SimulationCommand’, ‘stop’);

simulink test

I am using the test manager to run the tests in a model. In my Test Sequence editor I make a call to the following code as the last step.
coder.extrinsic('bdroot');
coder.extrinsic('set_param');
set_param(bdroot, 'SimulationCommand', 'stop');
This stops the model from being run. Since all the verify statements have been tested and passed they all turn green. However the Results, Test Suite and Test Case all say incomplete.
How can I have the test manager say the tests are complete despite stopping the simulation?

Best Answer

You must have an output of the Test Sequence block to a Stop Simulation block and have the Test Sequence block change the output to true when you want the simulation to stop.
Here are some steps:
1. Initialize a output variable to false in the Test Sequence block
2. In your proposed step in the Test Sequence block, change this output variable to true.
3. Connect this output to the Stop Simulation block, so that the Simulation is stopped by the Stop Simulation block.