Interrupt Events
Last updated
Last updated
The test file supports events, automatically raised by funTEST while specified action occurs. These events are defined as a sub-programs with special label names and format:
event-type
[string]
Event type to catch, see following section for supported events.
args
[string]
Optional arguments to specific event types.
Here is an example of how this looks like in a test file
Event sub-programs acts like standard asynchronously called methods (by funTEST), they can have passed some argument and must have a #return. Make sure that defined event is outside the main program loop. Recommended location is at the end of the test-file.
Occurs before the test file is closed. The closing can be refused by the #return argument
0 = refuse to close the test file, continue normally
(otherwise) = finish closing
Occurs after test-file has been closed. Any GUI (Operator interface) command is denied here.
Occurs after a new user is logged in (when another user is already logged in).
This label will be called by funTEST at specified time in a day. Call is repeated every day at this time. The time can be specified by hour only or also by minutes and seconds.
*event(run-at:1)
Run at 01:00.
*event(run-at:13:30)
Run at 13:30.
*event(run-at:15:10:30)
Run at 15:10:30.
This label will be called by funTEST repeatedly, after specified interval elapses. Time is defined by a sum of all parameters. It is possible to define the interval for example by only one parameter - passing i.e. 150 seconds is equivalent to 2 minutes and 30 seconds and so on. The next call is ignored when previous call is not finished.
*event(run-every:5)
Run every 0,5 second.
*event(run-every:0:30)
Run every 30 second
*event(run-every:0:0:60)
*event(run-every:0:0:0:1)