SIMUL ... ELSE_SIMUL ... END SIMUL

Ada Test Script Language

Purpose

The SIMUL, ELSE_SIMUL, and END SIMUL instructions allow conditional generation of test driver.

Syntax

SIMUL

ELSE_SIMUL

END SIMUL

Description

Code enclosed within a SIMUL block is conditionally generated depending on the status of the Simulation configuration setting in the HCL OneTest Embedded GUI, or the -nosimulation command line option of the Ada Test Script Compiler.

The SIMUL instruction starts the conditional generation block.

The END SIMUL instruction marks the end of the conditional block.

The ELSE_SIMUL instruction separates this block into two parts, one being included when the other is not, and vice versa.

This block of instructions can appear anywhere in the test program and can contain both Ada Test Script Language or native Ada code.

The SIMUL and END SIMUL instructions must appear as a pair. One cannot be used without the other.

The ELSE_SIMUL instruction is optional.

When using the HCL OneTest Embedded user interface, select or clear the Simulation option in the Component Testing for Ada tab of the Configuration Settings dialog box.

The code generation rules are as follows:

  1. If Simulation is enabled => the first part of the SIMUL block is included.
  2. If Simulation is disabled => the second part of the block (ELSE_SIMUL) is included if it exists. If there is no ELSE_SIMUL statement, then the SIMUL block is ignored.

Example

SIMUL

#x := 0;

ELSE_SIMUL

#x := 1;

END SIMUL

...

SIMUL

VAR x , INIT = 0 , EV = 1

VAR p , INIT = NIL , EV = NONIL

ELSE_SIMUL

VAR x , INIT = 0 , EV = 0

VAR p , INIT = NIL , EV = NIL

END SIMUL

Related Topics

Ada Test Script Compiler