This section explores how the report generator is invoked from the top-level process model entry points. The TestStand report generator is implemented in the TestStand process models, and the way the report generator is called differs based on the TestStand version you are using.
Report Generation Changes in TestStand 2012
The TestStand 2012 and later process models include significant changes to implement a plug-in architecture for model sequence files. This architecture is more complex, but has a number of benefits over the previous design; for example:
- Ability to generate multiple reports for a single test, each with independent report settings.
- Ability to generate reports asynchronously.
Due to the plug-in architecture changes, the way that the process models call the report generator changed significantly in TestStand 2012. The version specific sections below describe how the process models calls the format-specific report generation sequence files, which implement report generation. Despite the process model changes, the implementation of these format-specific report generation sequence files is very similar in TestStand 2010 SP1 and TestStand 2012. The image below provides an overview of the architecture changes and whether they contain significant changes in TestStand 2012 and later.
The TestStand 2012 model architecture changes the way the report generator is called, but not the report generator itself
Report Generation Sequence File Locations
While reading this document, it is helpful to inspect the report generation sequence files to view the implementation of each of the components. The table below contains the location of report generation files
|Sequence File Path
||Sequential process model.
|| (TestStand 2012 and later) Invokes Model plug-ins, including report generation plug-in.
|| (TestStand 2012 and later) Report generation process model plug-in.
|Format-Specific report generation sequence files - ATML, XML, HTML, and ASCII, repectively.
When you enable On-The-Fly Reporting option on the Contents tab of the Report Options dialog box, the process models progressively generate the report concurrently with the execution instead of waiting until UUT testing completes. In this case, the report is not generated in the same way. The ProcessOTFStepResult sequence, located in the format-specific sequence files, is instead invoked from an engine callback periodically through the test. the on-the-fly specific sections below describe this process for TestStand 2010 and previous and for TestStand 2012 and later.
TestStand 2012 and Later (post UUT Report)
In these TestStand versions, the report generator is implemented using a process model plug-in (NI_ReportGenerator.seq). The diagram below shows how the report generator is invoked:
The plug-in architecture allows all report generation code to be encapsulated in a single plug-in sequence file. Report generation functionality is implemented in sequences called Model Plug-in entry points, which are called by the process model entry points at various points in execution. Most of the functionality of the report generation plug-in is contained within the following plug-in entry points:
- Model Plugin - Initialize - load the currently configured report options
- Model Plugin - UUT Start - Obtain the report file path and create or load the report file
- Model Plugin - UUT Done - generate the report text and save it to the report file
The image below shows the point in execution where each of these processes are invoked by the Single Pass Entry point of the Sequential process model.
The report text itself is generated within the TestReport sequence, which is called from within the Model Plugin - UUT Done sequence. TestReport in turn calls sequences in the format-specific sequence file to generate the report text. The diagram below shows the call hierarchy from the entry point to the format-specific sequence file for generating the report body.
Call hierarchy for TestStand 2012 and later Post UUT report generation
TestStand 2012 and later (On-The-Fly Report)
When On-The-Fly reporting is enabled, the ProcessModelPostResults engine callback, which is invoked periodically throughout the execution. Unlike in TestStand 2010 and previous, this callback is not invoked after every step in the client sequence. When invoked, the Parameters.Results array contains a subset of the Resultlist containing all result data since the last invocation of the callback.
The ProcessModelPostResults calls the Model Plugin - OnTheFly Step Results sequence in the report generation plug-in, which in turn calls the ProcessOTFStepResults sequence in the format-specific sequence file to generate the report for the Results subset and append it to the report.
Call hierarchy for TestStand 2012 and later On-The-Fly report generation
TestStand 2010 SP1 and Previous (Post UUT Report)
In TestStand 2010 SP1, report generation functionality is implemented in many steps directly in the process model entry point. The image below shows the report generation steps in the Single Pass Entry point of the Sequential process model which implement these tasks:
- Load the currently configured report options
- Obtain the report file path, create or load the report file, and configure extra results to be included in the report, such as step limits
- Generate the report text and save it to the report file
- Post-processing the report, and regenerate the report path if the UUT status is part of the path
Note: The report is generated in section 3 below only when the on-the fly setting is disabled. When on-the-fly reporting is enabled, the report is generated in the ProcessModelPostResultListEntry engine callback, which is called after each step as the test executes. For more information on on-the fly reporting, refer to the On-The-Fly section of this document.
The report text itself is generated within the TestReport sequence, which in turn calls sequences in the format-specific sequence file to generate the report text. The diagram below shows the call hierarchy from the entry point to the format-specific sequence file.
TestStand 2010 SP1 and Previous (On-The-Fly Report)
When On-The-Fly reporting is enabled, the ProcessModelPostResultListEntry engine callback, which is invoked each time a new result is added to the ResultList. When invoked, the Parameters.Result container contains the newly added result.
The ProcessModelPostResultListEntry sequence calls the ProcessOTFStepResults sequence in the format-specific sequence file to generate the report for the Results subset and append it to the report.