Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
assay [test program and arguments]
In comparing the output assay ignores text demarked by two lines starting with >>> and <<<. This may be useful as in the following example, where the test program prints a quantity such as the execution time which is not expected to be reproducible.
The answer to the question of life the universe and everything is: 42 >>> Execution time: 5.4 aeons <<<
If there is a .in file associated with the test program then
assay redirects stdin from it.
If there are .in_* files then assay takes care they
exist (temporarily) in the working directory, so the test program
can find them there.
At the end assay takes care that all temporary files and directories are deleted. When the test program or script creates a temporary file or directory then it should be called name_tmp* where name is the name of the test program or glish script (e.g. tTable_tmp1.data).
It is permissible for a .exec to invoke assay (presumably with
arguments for the test executable) - the potential infinite recursion is
trapped.
Note that a .run has the advantage that one can massage the
output before assay gets it.
0
: success
1
: test execution failed
2
: test output disagreement
3
: untested (as returned from a .exec)
130
: interrupt
In addition, assay prints one of four POSIX 1003.3 compliant status messages referring to the result of the test execution:
PASS (execution succeeded):
<test executable and arguments>
FAIL (execution failure):
<test executable and arguments>
PASS (output verified):
<test executable and arguments>
FAIL (output not verified):
<test executable and arguments>
assay is used by the test makefile (makefile.tst) which uses assay to invoke the test executable without arguments. Where test programs do need to be invoked with particular arguments a .exec or .run must be provided. The following example, tIncrementalStMan.exec, uses assay to invoke tIncrementalStMan multiple times with different arguments:
#!/bin/sh #-------------------------------------------------------------------------- # Script to invoke tIncrementalStMan and verify its output. #========================================================================== exec assay tIncrementalStMan "1000 && \ tIncrementalStMan 2000 && \ tIncrementalStMan 3000 && \ tIncrementalStMan 4000 && \ tIncrementalStMan 5000 && \ tIncrementalStMan 0"
In this example note that assay is exec'd to save generating another process, and also that tIncrementalStMan.out is expected to contain the output from tIncrementalStMan for all six runs.