5. Generating template of .t2c file

T2C file generator creates source code of the tests based on the parameterized test scenarios contained in a .t2c file. Each parameterized test scenario is in fact much like a document with holes. Its parts are written in the target programming language (C, in this case) but special placeholders can be left in it to be filled later with the actual values of test parameters.

ReqMarkup plugin can generate a template for a parameterized test scenario for each function (it is not mandatory to use this functionality, sometimes it can be more convenient to do everything by hand). The template contains a <BLOCK> section for each function for which the requirements are marked up in the document. The names of the functions is determined from the identifiers of the requirements. For each requirement for a function, a REQ() call is placed in the corresponding <BLOCK> along with the text of the requirement in the comments above the REQ() (this macro is described in detail in Section 4.1.5, “REQ( ) and REQva( )”).

To show the template, press Show Template button on the toolbar. The template will be shown in a separate window. If you want a template for a specific function rather than for all functions at once, specify the name of the function in Filter by function name field (a regular expresion can also be used as a filter here) and press Generate button.

Template of .t2c file

If the window showing the template is open, its contents are not updated automatically when the corresponding HTML file changes. To update the template, you should press Generate button in this window.