BEGIN

Ada Test Script Language

Purpose

The BEGIN instruction marks the beginning of the Ada code generation. The BEGIN GENERIC option is specifically for testing Ada generic packages.

Syntax

BEGIN [ <parent_unit> [ , <procedure> ] ]

BEGIN GENERIC( <generic_package>, <instance> ) [, <procedure> ]

where:

  • <parent_unit> is the full name of the unit under test.

    <procedure> is the name of the generated separate procedure, by default ATTOL_TEST.

    <generic_package> is the name of a generic unit under test.

    <instance> is the name of the instanciated unit from the generic.

Description

The BEGIN instruction is mandatory and must be located after a HEADER statement, and before any other Ada Test Script instruction.

By default, the Ada Test Script Compiler creates an independent compilation unit. To test private elements of a package you must first generate a procedure.

The reference body to the separate procedure must be written in the parent unit package.

If a BEGIN keyword is not found in the test script, a warning message is generated and a BEGIN instruction is implicitly created before the first occurrence of a SERVICE instruction.

To test a generic package, you need to generate the test driver separately and call it as a procedure of the instance. Use the BEGIN GENERIC syntax to automatically generates a separate procedure <procedure> of <generic_package>. This allows you to access the procedure <instance> . <procedure_name>, which is generated by the Ada Test Script Compiler.

Note This technique also allows testing of private types within the generic package.

Related Topics

HEADER | SERVICE