ENVIRONMENT ... END ENVIRONMENT

Ada Test Script Language

Purpose

The ENVIRONMENT instruction defines a test environment declaration, that is, a default set of test specifications.

Syntax

ENVIRONMENT <name>

END ENVIRONMENT

<name> is a mandatory identifier that provides a unique environment name.

Description

The test environment defines a general context. Variables which are declared within a context can be overwritten by a TEST statement.

The END ENVIRONMENT instruction marks the end of an environment declaration.

<name> specifies an environment name that is referenced in the USE instruction.

An environment must be defined after the BEGIN instruction.

Each environment is visible in the block in which it has been declared and in any blocks included in this block, after its declaration.

An environment can only contain VAR, ARRAY, STR, FORMAT or STUB instructions and conditional generation instructions. If it is empty, a warning message is generated.

An environment is activated by the USE instruction that defines its scope and its priority. ENVIRONMENT blocks are executed in the reverse order of their respective USE instruction.

Note If the USE instruction follows directly the ENVIRONMENT block, the first occurrence of the ENVIRONEMENT overrides the later, or local ones.

After generating the initializations and the tests of an ELEMENT block, visible environments are included in order of priority, at every END ELEMENT instruction, in order to complete the initializations and tests.

The scope of an ENVIRONMENT block is important insofar as only "visible" environment blocks apply, and use clauses can be out of scope.

Example

ENVIRONMENT compute_histo

VAR x1, init = 0, ev = init

VAR x2, init = SIZE_IMAGE-1, ev = init

ARRAY image, init = 0, ev = init

END ENVIRONMENT

Related Topics

VAR | ARRAY | STR