User`s guide
Verify Generated Code for a Component
12-7
2
Add the new test case to the Signal Builder block in the harness model.
signalBuilderBlock = slvnvdemo_signalbuilder_block(harnessModel);
signalbuilder(signalBuilderBlock,'Append',...
newTestTime, newTestData,...
{'endstop','obstacle','driver(1)','driver(2)','driver(3)',...
'passenger(1)','passenger(2)','passenger(3)'},'New Test Case');
3
Simulate the harness model with both test cases, then log the signals to the
referenced model, and save the results:
loggedSignalsHarness = slvnvlogsignals(harnessModel);
Next, record coverage for the slvnv_powerwindow_controller model.
Merge Test Case Data
You have two sets of test case data:
• loggedSignalsPlant — Logged signals to the Model block control
• loggedSignalsHarness — Logged signals to the test cases you added to the empty
harness
To simulate all the test data at the same time, merge the two data files into a single data
file:
1
Combine the test case data:
mergedTestCases = slvnvmergedata(loggedSignalsPlant,...
loggedSignalsHarness);
2
View the merged data:
disp(mergedTestCases);
Next, simulate the referenced model with the merged data and recover coverage for the
referenced model, slvnv_powerwindow_controller.
Record Coverage for Component
Model coverage is a measure of how thoroughly a test case tests a model and
the percentage of pathways that a test case exercises. To record coverage for the
slvnv_powerwindow_controller model:
1
Create a default options object, required by the slvnvruntest function: