%% Generating Test Cases from a Model
%
% Generate test cases based on model hierarchy. 
%
% Copyright 2015 The MathWorks, Inc.

%%
% This example shows how to generate test cases based on the components in your model.
% This example uses the model |sltestCar|, which has been pre-configured 
% with the following:
%
% * Signal Editor block at the top level of the model
% * Test harnesses at the top level of the model 
% * Signal Editor block at the top level of the test harness

%% Open the Model and Test Manager
%
% Execute the following code to open the model configured with different 
% components such as Signal Editor scenarios and test harnesses.
Model = 'sltestCar';
open_system(Model);

%%
% Open the test manager. Enter |sltestmgr| in the MATLAB command prompt.

%% Generate Test Cases From the Model
% In the test manager, click the *New* arrow and select *Test File from Model*.

%%
% <<../gen_testcases_new.png>>

%%
% # In the *New Test File* dialog box, click the *Use current model* button
% to specify |sltestCar| as the *Model*.
% # Specify the *Location* of the test file.
% # Select the |Baseline| from the *Test Type* dropdown. All test cases 
% generated will be of the test type specified here. 
% # Click *Create*. 

%%
% <<../gen_testcases_newtestfile.png>>

%%
% The sltestCar/Inputs test case uses table iterations.
%%
% <<../gen_testcases_iterations.png>>
%% 
% Before you run the test, you must specify the baseline criteria for each 
% generated test case. 

%%
close_system(Model, 0);
clear Model;
