harness(n) 2.1 harness "Harness Package"

Name

harness - Commands for the harness package

Table Of Contents

Synopsis

Description

The harness package implements Tcl commands to interact with a test harness program that was generated using tack. The primary function performed by harness is to encapsulate the communications protocol used by tack generated test harnesses.

COMMANDS

The package exports a single ensemble command to connect to a test harness.

harness open ?service1? ?service1 ...?

The open method creates sockets for the services mentioned as arguments. Services names should be either driver or stub corresponding to the two communications services that a test harness supplies. Commands to control the domain are sent down the driver service port and output from external operations, event tracing and other output from the application are received on the stub service port. The return value of the command is a fully qualified name of a command that has methods that can be used to interact with the test harness. Typically, scripts open both the driver and stub ports as shown below.

set hcmd [harness open driver stub]

HARNESS METHODS

The return value from harness open is the name of a command which has the following methods. The return value of the commands associated with interacting with the test harness is a dictionary with the following keys:

plus other keys that are dependent upon the command, as described below.

$hcmd invoke domain opname ?oparg1 oparg2 ...?

The invoke method causes the test harness to invoke the domain operation, opname within in domain , domain, passing the opargN arguments.

$hcmd read domain class inst attr

The read method reads the value of the attr attribute of instance inst of class class in domain domain, returing its value. The inst argument may be either the name of a named instance or a number.

$hcmd update domain class inst attr value

The update method writes the value arguement value to the attr attribute of instance inst of class class in domain domain. The inst argument may be either the name of a named instance or a number.

$hcmd event domain class inst event ?param1 param2 ...?

The event generates the event named, event to the inst instance of class class in domain, domain passing any option values of paramN.

$hcmd polyevent domain class inst event ?param1 param2 ...?

The event generates the polymorphic event named, event to the inst instance of class class in domain, domain passing any option values of paramN.

$hcmd delay domain class inst delay event ?param1 param2 ...?

The delay method operates like the event except the event is delayed by delay milliseconds.

$hcmd polydelay domain class inst delay event ?param1 param2 ...?

The delay method operates like the polyevent except the event is delayed by delay milliseconds.

$hcmd trace ena

The trace turns on state machine tracing if the boolean valued argument, ena, is true and turns off state machine tracing otherwise.

$hcmd close

The close terminates the communications connections to the test harness application.

$hcmd cget service

The cget method returns the socket channel identifiers for the given serivce. The service argument must be one of "driver" or "stub". Access to the socket channel is sometimes needed in order to be able to configure the channel, e.g. to post file events or changing its blocking characteristics.

See Also

pycca, tack