Test Sequence block reporter
Use an object of the
slreportgen.report.TestSequence class to report on a
Test Sequence block. Using a Test Sequence block in a
Simulink model requires Simulink
By default, a
TestSequence reporter generates:
Property tables for all of the symbols — input, output, local, constant, parameter, and data store memory
A nested list for the step hierarchy
Details for each step including the step description,
condition, action statements, and a table of transition conditions and next steps
If the Test Sequence block uses scenarios, the
reporter includes the scenario parameter in the parameters table and a list for each scenario
in the step hierarchy. In the report, scenarios are identified by the scenario icon. The
active scenario is also identified by the word
Active followed by the
active scenario icon. For example:
The reporter adds a note to the report when the active scenario is controlled in the workspace. In this case, the active scenario is not identified in the report.
TestSequence reporter properties to filter the content and
customize the content formatting.
To use an
slreportgen.report.TestSequence reporter in a report, you
must create the report using the
slreportgen.report.Report class or
slreportgen.report.TestSequence class is a
For information on class attributes, see Class Attributes.
creates an empty
reporter = slreportgen.report.TestSequence()
TestSequence reporter object based on the default
template. You must specify a Test Sequence block to report by setting the
property. Use other properties to specify report options.
reporter = slreportgen.report.TestSequence(
TestSequence reporter and sets the Object
property to the specified Test Sequence block.
sets the reporter properties using name-value pairs. You can specify multiple name-value
pair arguments in any order. Enclose each property name in single or double quotes.
reporter = slreportgen.report.TestSequence(
Object— Test Sequence block to report
(default) | character vector | string scalar | handle |
IncludeSymbols— Whether to include symbols
Whether to include symbols in the report, specified as
true, the report includes property tables for the symbols. In the
input and output symbol property tables, the symbols are sorted by the port number. In
the local, constant, parameter, and data store memory tables, the symbols are sorted by
the symbol name.
If the model was compiled before report generation, the values in the property
tables are the values after compilation. Otherwise, the property values are the values
before compilation and a note at the end of the Symbols section states that the model
was not compiled. By default, models are compiled during report generation. You can
control whether a model is compiled during report generation by setting the
CompileModelBeforeReporting property of the
slreportgen.report.Report object that includes this reporter.
IncludeStepHierarchy— Whether to include step hierarchy
Whether to include the step hierarchy, specified as
true, the report includes the step hierarchy as a nested list. The
step name in the list links to the corresponding step content in the report.
IncludeStepContent— Whether to include step content
Whether to include step content, specified as
true, the report includes the content for each step. In the
reported step content, the step name links to the step hierarchy in the report. You can
filter the reported step content by using the IncludeStepDescription, IncludeStepWhenCondition, IncludeStepAction, IncludeStepTransitions, and IncludeStepRequirements properties.
IncludeStepDescription— Whether to include step description
Whether to include the step description in the content reported for a step,
IncludeStepWhenCondition— Whether to include step
Whether to include the step
When condition in the content
reported for a step, specified as
When condition is the condition that activates a
When decomposition child step.
IncludeStepAction— Whether to include step actions
Whether to include the step actions in the content reported for a step, specified as
IncludeStepTransitions— Whether to include step transitions table
Whether to include the step transitions table in the content reported for a step,
false. The step transitions
table contains the transition conditions and the next steps.
IncludeStepRequirements— Whether to include step requirements
Whether to include a link to the step requirements in the content reported for a
step, specified as
false. Linking to the
step requirements requires Simulink
TableReporter— Table formatter
Table formatter for tables generated by this reporter, specified as an
mlreportgen.report.BaseTable object. The default value of this property is a
BaseTable object with the
set to the
TestSequenceTable style, which is defined in the default
template for a
TestSequence reporter. To customize the appearance of the
table, modify the properties of the default
BaseTable object or replace
it with your own
BaseTable object. If you add content to the
Title property of the
BaseTable object, the
content appears in front of the table title in the generated report.
ListFormatter— Formatter for step hierarchy list
The default value of this property is an
UnorderedList object with
StyleName property set to the
TestSequenceList style, which is defined in the default template
TestSequence reporter. To customize the appearance of the list,
modify the properties of the default
UnorderedList object or replace the
object with your own
TemplateSrc— Source of template for this reporter
(default) | character vector | string scalar | reporter or report | DOM document or document part
Source of the template for this reporter, specified in one of these ways:
Character vector or string scalar that specifies the path of the file that contains the template for this reporter
Reporter or report whose template is used for this reporter or whose template library contains the template for this reporter
DOM document or document part whose template is used for this reporter or whose template library contains the template for this reporter
The specified template must be the same type as the report to which this
reporter is appended. For example, for a Microsoft® Word report,
TemplateSrc must be a Word reporter template. If
TemplateSrc property is empty, this reporter uses the default
reporter template for the output type of the report.
TemplateName— Name of template for this reporter
Name of the template for this reporter, specified as a character vector or string
scalar. The template for this reporter must be in the template library of the template
TemplateSrc) for this reporter.
LinkTarget— Hyperlink target for this reporter
(default) | character vector | string scalar |
Hyperlink target for this reporter, specified as a character vector or string scalar
that specifies the link target ID, or an
mlreportgen.dom.LinkTarget object. A character vector or string scalar
value is converted to a
LinkTarget object. The link target immediately
precedes the content of this reporter in the output report.
|Create Test Sequence block reporter template|
|Create custom Test Sequence block reporter class|
|Get location of Test Sequence block reporter class definition file|
|Create copy of a Simulink reporter object and make deep copies of certain property values|
|Get implementation of reporter|
slreportgen.report.TestSequence object to
report on a Test Sequence block.
Import the MATLAB Report and Simulink Report API packages so that you do not have to use long, fully qualified class names.
import mlreportgen.report.* import slreportgen.report.*
Create a Simulink report.
rpt = slreportgen.report.Report("myTestSequenceReport","pdf");
Load a model that has a test harness.
model_name = "sltestTestSequenceExample"; load_system(model_name);
Find and load the test harness that contains the Test Sequence block to report.
harness = sltest.harness.find(strcat(model_name,"/shift_controller")); sltest.harness.load(harness.ownerFullPath,harness.name); testSeqObj = strcat(harness.name,"/Test Sequence");
Create a chapter for the Test Seqence block.
chapter = Chapter(testSeqObj);
Create a reporter for the Test Seqence block.
rptr = TestSequence(testSeqObj);
Append the reporter to the chapter and the chapter to the report.
Close the report, test harness, and model. View the report.
close(rpt); sltest.harness.close(harness.ownerFullPath,harness.name); close_system(model_name); rptview(rpt);
Test Sequence (Simulink Test)