RUN

C++ Test Script Language

Syntax

RUN { <run item> }

Location

TEST CLASS, OTD Script

Description

The RUN statement defines the behavior of the surrounding test class.

<run item> may be one of the following entities:

  • Test class name

    Test suite name

    Test case name

These names refer to a component defined in the surrounding test class or in an inherited test class. Order is meaningful. They can refer to a nested item (the nesting sequence is specified with the list of identifiers, from the most-surrounding to the most-nested one, separated by a dot).

The RUN statement can be located either within a TEST CLASS or at the root level of a C++ Test Driver Script:

  • When used in aTEST CLASS, theRUNstatement defines the behavior of the surroundingTEST CLASS.

  • When used at the root level of a script, the RUN statement defines which entities are to be run when the script is executed. The RUN items can refer to any entity of the script.

Only one RUN statement is allowed at the root of a script or within each TEST CLASS.

The RUN statement is not allowed in included scripts.

RUN items are executed sequentially.

Example

TEST CLASS ATest

{

TEST CASE tc1 {

#s.push (i);

CHECK (!s.full ());

}

TEST CASE tc2 {

#s.pop ();

CHECK (!s.empty ());

RUN {

tc1; tc2; tc2; tc1;

}

}