If you have created a Simulink® model test harness using a Signal Builder block, you can automate the running of all your test cases by integrating them into a SystemTest™ test. This also offers the ability to collect cumulative model coverage metrics for all your Signal Builder test cases.
The most common workflow for this feature is to create a Simulink element and then create the test vector from within the element, as follows:
In the SystemTest desktop, create a Simulink element by clicking the Main Test node in the Test Browser, and clicking the New button. Select Test Element > Simulink.
Type the name of the model, or use the Browse button to locate it. This should be the model that includes the Signal Builder block whose test cases you are interested in.
When you click OK, the model opens.
This example uses the model systemtestsfcar.
In the Simulink element, click the up arrows in the banner of the Override Inport Block Signals with SystemTest Data section to close it.
Click the down arrows in the banner of the Run Signal Builder test cases from SystemTest section to expand it.
Enable the Signal Builder test cases by selecting the Use test vector check box.
Click the down arrow and select <New Signal Builder Block test vector...>.
The Insert Test Vector dialog box opens and Signal Builder Block is the selected test vector type.
Keep the default test vector name or type a new one.
On the General tab, type the name of the model you used in the Simulink element, or click the Browse button to locate it.
When the model is found, the Signal Builder test cases appear in the Test Cases section.
If there are any test cases you do not want to test, you can disable them using the check boxes. Test cases that are checked will be tested.
You can click the Test Signals tab to view the test signals associated with your Signal Builder block.
Click OK to finish creating the test vector.
To view or edit the test vector after it is created, click the Test Vectors tab in the SystemTest desktop.
Optionally create other elements, test vectors, variables, or saved results, and run your test.
Note: If you make changes in the underlying Signal Builder block in your model, you can click the Evaluate button in the Test Vectors pane any time to see the changes reflected in the user interface. However this is not necessary to pick up the changes for running the test. When you run a test containing a Signal Builder Block test vector, the SystemTest software automatically queries the model for the latest information in the Signal Builder block.
Note: You may have tested a Signal Builder block in previous SystemTest versions by using the Override Block Parameters with SystemTest Data section of a Simulink element. In that scenario you would create a new mapping to the Signal Builder block.
However, using the Run Signal Builder test cases from SystemTest section in the Simulink element and creating the Signal Builder Block test vector is a better and easier solution. Because the Signal Builder test cases are in a test vector, you can do more with them, such as plotting. Also, the signals are stored in the SystemTest results set, rather than the index of the test case.
Note that if you have a Simulink element that contains the mappings from the former way of including a Signal Builder block, and then you use the new Signal Builder Block test vector and use the new section in the same Simulink element, the test will use the new information in the Run Signal Builder test cases from SystemTest section in the Simulink element.