-
Notifications
You must be signed in to change notification settings - Fork 1
Example Test Other Things Than Executable Files
The "actor" is responsible for executing the act phase -
the contents of [act].
It is set in [conf] by the actor configuration parameter.
Exactly supports a couple of such "actors".
The default actor is "command line".
Preceding the command with a $ specifies that
the rest of the line is a shell command line:
[act]
$ echo 'Hello, World!'
[assert]
stdout equals <<EOF
Hello, World!
EOF
The "file interpreter" actor interprets a source file.
An interpreter must be specified, by giving an executable file. The interpreter may be a file located on the PATH:
[conf]
actor = file % python
[act]
my-argument-printer.py 'an argument' more arguments
[assert]
stdout equals <<EOF
Argument 1: an argument
Argument 2: more
Argument 3: arguments
EOF
A test case does not need to have an act phase. In that case, the "null" actor is used.
This can be used to test existence of files and directories etc.
But the test case is still executed in a temporary sandbox directory. This means that file names must not be relative the current directory.
-rel-act-home may be used to refer to files relative the location of the test case file.
For example, if the following test case is located in a file
null-actor-example.case, then it will PASS:
[assert]
exists -rel-act-home null-actor-example.case : type file
act-home can be set to a different directory if that is more convenient.
[conf]
act-home = /etc
[assert]
exists -rel-act-home passwd : type file