SourceForge.net Logo
prevtopnext
izh_test
    Kinds of tests
        Terminal tests
exec_check - Simplest test for console program.

Test includes executing of program and checking the result that the program writes in the standard output stream.

Full specification of the test looks like:
<exec_check>
  <spec>
    <sname>short_name_of_test</sname>
    <fname>full name of test</fname>
    <descr>description of test</descr>
  </spec>
  <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>  
  <res>expected return value</res>  
  <result_file>result file name</result_file>
</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.

res

Expected code of return for tested program.

By default it is zero.

If tested program returns another code, izh_test produces warning.

result_file

Name of file which will be used to store real content of the standard output stream for the tested program..

If this field is empty than name of result file will be built as described in the definition of field out.

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% .

This field is used usually if name of the etalon file coincide with name of the result file for another test ( for example, for testing of read-write )

Identification specification spec is standard for all the tests:
spec Identification information for the test (names, descriptions)
sname Short name for test, that is used as test name in GUI-runner and as component of path to the test in console runner . The sname should not contain line breaks. It is better if the sname is short and without white spaces.
fname Full name of test is used as test name in console runner . The fname should not contain line breaks. The fname is placed in one line/screen. So it would be better if the fname is less than 60 symbols.
descr Full description of test. It can be as long as you need and contain any number of line breaks. The description can be shown in the console and GUI runner by special command only.

Test 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 test returns unsuccessful flag.


prevtopnext

SourceForge.net Logo