SourceForge.net Logo
prevtopnext
izh_test
    Kinds of tests
        test_script - Sequence of simple test actions
Introduction

Test script is a sequence of simplest actions (commands). Each command in test script can be a source of "test file results" .

Test script is used as low level tool in various non standard situations. It allows working with files (copy, rename, remove), and with environment variables, to execute external programs from command line, to compare many files with etalons and so on.

Test script is executed as one thing and all the "test file results" (files to compare with etalon) for each test command look as the results of the whole test script. So test commands don't have identification specifications (names). Only the test script as whole thing has identification specification.

As example simplest standard test exec_check can be rewritten as test script included two commands exec and check . If it is need, between exec and check can be executed some commands (for example normalization of result file).

Special command with name exec_check exists too (it is full analog of the test except identification specification). For example, it can be used with another check . This command can check changing of file that is a side effect of tested program.

exec can be used to prepare data for test or to clean data after test.

Aside from, there is a special test command to execute any test (identification specification of the test is ignored in this case) As example it's convenient to use test exec_check_directory as part of test script .

Full specification of the test looks like:
<test_script>
  <spec>
    <sname>short_name_of_test</sname>
    <fname>full name of test</fname>
    <descr>description of test</descr>
  </spec>
  <params>         .. named params              .. </params>
  <safe_params>    .. named params if undefined .. </safe_params>
  <items>
                   .. items of script           .. 
  </items>
</test_script>
Where:
params, safe_params Definitions of substitution variables for using in test component.
itemsList of test command specifications.
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