SourceForge.net Logo
prevtopnext
izh_test
    Kinds of tests
        test_script - Sequence of simple test actions
exec_check - Execution of external program and comparing of its result with etalon

The command allows doing all the actions that can be done by test with the same name exec_check .

Full specification of the command looks like:
<exec_check>
  <cmd>command line for test</cmd>
  <out>test result base path</out>
  <in>name of file to send to input</in>
  <input>text to send to input</input>
</exec_check>
Where:
cmd

Command line to launch tested program.

Output of the program is compared with etalon.

izh_test adds nothing to the command line when launch the program (except substitution of variables) from arbitrary place in the file system.

So you have to use absolute path to the launched file or use the system substitution variable %test_dir% , which is replaced by the path to the directory with file-description of the test.

out

Base file name for "test file result".

Usually this file name has an extension.

If the file name looks like [name].[last_extension] then

  • name of the result file will be [name].result.[last_extension],
  • name of the etalon file will be [name].etalon.[last_extension],
  • name of the file difference will be [name].diff.

Before using of these file names izh_test adds path to the directory with file description of the test to it so you don't have to use %test_dir% .

in

Name of file. Its content will be sent to the standard input stream of the tested program.

If fields in and input (see below) are empty then izh_test will send nothing to the standard input stream of the tested program.

Before using of this file name izh_test adds path to the directory with file description of the test to it so you don't have to use %test_dir% .

input

Text which will be sent to the standard input stream of the tested program.

This field is used only if field in (see previous definition) is empty.

Otherwise (field in contains name of file with data), izh_test will send content of file with name in but content of field input will be ignored.

If fields in and input (see above) are empty then izh_test will send nothing to the standard input stream of the tested program.

So as this test command can be executed only as part of a test script , which already has identification specification with names, own identification specification with names for the command is not needed unlike test with the same name

The command only compares content of result file with content of etalon file.

If contents of files are the same then result file is deleted.

If contents of files are not the same then result file is not deleted and the command returns unsuccessful flag.

The command can be used as example to test programs which change files in the directory except using standard output stream. Such changes can be checked from the same test script , using test command check .


prevtopnext

SourceForge.net Logo