IF ... ELSE ... END IF

Ada Test Script Language

Purpose

The IF, ELSE and END IF statements allow conditional generation of the test driver.

Syntax

IF <condition> { , <condition> }

ELSE

END IF

where:

Description

These statements enclose portions of script that are included depending on the presence of one of the conditions in the list provided to the Ada Test Script Compiler by the -define option.

The <condition> list forms a series of conditions that is equivalent to using an expression of logical ORs.

The IF instruction starts the conditional generation block.

The END IF instruction terminates this block.

The ELSE instruction separates the condition block into 2 parts, one being included when the other is not.

Associated Rules

<condition> is any identifier. You must have at least one condition in an IF instruction.

This block can contain any code written in Ada Test Script Language or native Ada.

IF and END IF instructions must appear simultaneously.

The ELSE instruction is optional.

The generation rules are as follows:

Example

IF test_on_target

  VAR register, init == , ev = 0

ELSE

  VAR register, init = 0 , ev = 0

END IF

 

Related Topics

SIMUL ... ELSE_SIMUL ... END SIMUL