C++ test driver script (.otd)

Component Testing for C++ uses its own simple language for test driver scripting.

This section describes each keyword of the C++ test driver script language, including:

  • Syntax

  • Functionality and rules governing its usage

  • Examples of use

Notation conventions

Throughout this section, command notation and argument parameters use the following standard convention:

Notation Example Meaning
BOLD BEGIN Language keyword
<italic> <filename> Symbolic variables
[ ] [ <option> ] Optional items
{ } { <filenames> } Series of values
[{ }] [{ <filenames> } ] Optional series of variables
| on|off OR operator

C++ test driver script keywords are case insensitive. This means that STUB, stub, and Stub are interpreted the same way.

For conventional purposes however, this document uses upper-case notation for the C++ test driver script keywords in order to differentiate from native source code.

Split statements

C++ test driver script statements may be split over several lines in an .otd test script. Continued lines must start with the ampersand ('&') symbol to be recognized as a continuation of the previous line. No tabs or spaces should precede the ampersand.

Statements must be shorter than 2048 characters, although this limit may be lower on some platforms.

Language identifiers

A C++ test script identifier is a text string used as a label, such as the name of a TEST or a STUB in an .otd test script.

Identifiers are made of an unlimited sequence of the following characters:

  • a-z

  • A-Z

  • 0-9

  • _ (underscore)

Spaces are not valid identifier characters.

Note that identifiers starting with a numeric character are allowed. The following statement, for example, is syntactically correct:

TEST CASE 1

{

..

}

C++ test driver script identifiers are case sensitive. This means that LABEL, label, and Label are three different identifiers.

Related Topics

C ++ test driver script structure | C++ test driver script keywords | C++ contract check scripts (.otc)