Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: Diagnostic makefile rules Up: System verification Previous: System verification

Subsections



assay

Invoke an AIPS++ test program or glish script, verify its output, and delete temporary files.

Synopsis

assay [test program and arguments]

Description

assay invokes an AIPS++ test program or glish script. If the program name has the suffix .g then it is a test glish script which is executed using the glish command. Otherwise it is a normal test program.
If the test program or glish script has an associated .exec file then assay invokes it using the exec command. Otherwise if it has an associated .run file then assay invokes it by simply starting it in another process.
If there is a corresponding .out file, assay compares the output of the program or script with that.

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.

Options

None.

Notes

Diagnostics

Status return values
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>

Examples

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.

See also

Section 12.2, diagnostic makefile rules.

Author

Original: 1995/11/01 by Mark Calabretta, ATNF.


next up previous contents index
Next: Diagnostic makefile rules Up: System verification Previous: System verification   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15