SourceForge.net Logo
prevtopnext
izh_test
    Kinds of tests
        Terminal tests
exec_check_directory - Test for console program that changes files.

This is a kind of test to test program that doesn't only write something to the standard output stream but also changes files in the directory that it launched from.

Next approach is used for such programs:

  1. Special directory "t" is being prepared and filled with test content "before work of tested program"
  2. Special directory "e" is being prepared and filled with etalon content "after work of tested program"
  3. To execute test, izh_test copies content of directory "t" to directory "r" and launches tested program in this directory ("r").
  4. When tested program finished izh_test compares content of directory "r" with content of directory "e".
  5. Like for usual exec_check izh_test compares standard output of the tested program.

Full specification of the test looks like:
<exec_check_directory>
  <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>test return code to compare with</res>
  <path>test path</path>
  <main>test main result file</main>
</exec_check_directory>
Where:
cmd

Command line to launch tested program.

Result of work of this program is compared with etalon.

izh_test adds nothing to the command line when launches the program (except substitution of variables) from subdirectory "r" of directory defined by field "path". The directory "r" is filled by content of subdirectory "t" of directory defined by field path

out

Base file name for "test file result".

By default is "output.txt".

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.

path

Path to the test directory with subdirectories which contain etalon data "before work" ("t") and "after work" ("e").

It is defined relative of the directory where placed file with test specification.

main

Is used usually for gui-tests.

This field defines which file from the directory "after test" will be main (which file should be compared first).

It is convenient for example sometimes for testing reports, When report isn't written in the standard output stream but stored in a file.

This file name is defined relatively on the directory where test is run ("r").

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.

prevtopnext

SourceForge.net Logo