SourceForge.net Logo
prevtopnext
izh_test

itr - program to run tests from console

Console tool to run tests ( izh_test runner).
itr.exe Ver 1.0
Copyright (C) 2006 IzhSoft
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
Usage: itr [OPTIONS]
  -h, --help          Display this help and exit.
  --path=name         Read tests from file .
  --format=#          Use output format #.
  --test=name         Use test by path .
  -p, --print         Print readable tests paths and exit.
  --result_pos=#      Use test result with position #.
  -c, --clean         Clean test results and exit.
  -e, --erase         Erase test results+etalons and exit.
  -f, --fix           Fix test result and exit.
  -g, --gui           Run gui tool to work with the tests.
  -i, --ttimer        Use test timer (for debugging).
  -s, --skip_pwd      Skip current directory in output (for debugging).
Options:
help launched with this option itr outputs short help information.
path

This parameter points path to the file with xml specification of test ( izh_test descriptor)

Also you can point this parameter without name:
itr package.itd.xml
format

This parameter defines format of output for program.

At the present there are next formats supports:

  • default
  • silence
  • result
Descriptions of each format see below.

test The option allows pointing path to the test in the test tree.
print The option allows printing paths of tests for the package .
result_pos The option allows selecting one of the test file results .
clean The option allows to clean the test file results (to delete result file and etalon file)
erase The option allow to remove the test file results (to delete result file, difference file and etalon file)
fix The option allows to fix the test file results corresponded with the result file (to copy result file instead of etalon file)
gui The option allows to launch gui-tool for working with tests
ttimer The option forces to use test time function (used only for debugging of itr)
skip_pwd The option points that there should be only determined paths in the output (used only for debugging of itr)

Let's imagine we have next test in file named package.itd.xml:
<package>

  <spec>
    <sname>test short name for package</sname>
    <fname>test full name for package</fname>
    <descr>test descr for package</descr>
  </spec>

  <tests>

    <empty_test>
      <spec>
        <sname>test short name 1</sname>
        <fname>test full name 1</fname>
        <descr>test descr 1</descr>
      </spec>
    </empty_test>

    <fail>
      <spec>
        <sname>fail short name 1</sname>
        <fname>fail full name 1</fname>
        <descr>fail descr 1</descr>
      </spec>
    </fail>

    <empty_test>
      <spec>
        <sname>test short name 2</sname>
        <fname>test full name 2</fname>
        <descr>test descr 2</descr>
      </spec>
    </empty_test>


    <package>
      <spec>
        <sname>test short name for package 2</sname>
        <fname>test full name for package 2</fname>
        <descr>test descr for package 2</descr>
      </spec>
      <tests>
        <empty_test>
          <spec>
            <sname>test short name 1 2</sname>
            <fname>test full name 1 2</fname>
            <descr>test descr 1 2</descr>
          </spec>
        </empty_test>
        <empty_test>
          <spec>
            <sname>test short name 2 2</sname>
            <fname>test full name 2 2</fname>
            <descr>test descr 2 2</descr>
          </spec>
        </empty_test>
      </tests>
    </package>

  </tests>

</package>

By default itr will describe result of each test:
>itr package.itd.xml
<------------------------------------------------------------------------------
- test full name for package                                 08:17:41,00
   test full name 1                                          08:17:41,01   [ok]
   fail full name 1                                          08:17:41,01 [fail]
   test full name 2                                          08:17:41,01   [ok]
<------------------------------------------------------------------------------
- test full name for package 2                               08:17:41,01
   test full name 1 2                                        08:17:41,01   [ok]
   test full name 2 2                                        08:17:41,01   [ok]
>--------------------------------------------------------------------------[ok]
>------------------------------------------------------------------------[fail]

The same result can be reached by running itr with format "default":
>itr package.itd.xml --format=default
<------------------------------------------------------------------------------
- test full name for package                                 08:17:41,00
   test full name 1                                          08:17:41,01   [ok]
   fail full name 1                                          08:17:41,01 [fail]
   test full name 2                                          08:17:41,01   [ok]
<------------------------------------------------------------------------------
- test full name for package 2                               08:17:41,01
   test full name 1 2                                        08:17:41,01   [ok]
   test full name 2 2                                        08:17:41,01   [ok]
>--------------------------------------------------------------------------[ok]
>------------------------------------------------------------------------[fail]

If itr is launched with format "silence" then itr outputs nothing:
>itr package.itd.xml --format=silence
But result of the test can be found out by return code of the program. The tests are successful if the return code is zero. So it is convenient to use format "silence" in scripts and batch files.

If itr is launched with format "result" then itr prints simple result of testing without detailed information for each test:
>itr package.itd.xml --format=result
|test full name for package| - [fail]

Option --print allows printing the list of the test without running them:
>itr package.itd.xml --print
/test short name for package
/test short name for package/test short name 1
/test short name for package/fail short name 1
/test short name for package/test short name 2
/test short name for package/test short name for package 2
/test short name for package/test short name for package 2/test short name 1 2
/test short name for package/test short name for package 2/test short name 2 2
Option --print can be combined with option --test:
>itr package.itd.xml --print --test="/test short name for package/test short name for package 2"
/test short name for package/test short name for package 2
/test short name for package/test short name for package 2/test short name 1 2
/test short name for package/test short name for package 2/test short name 2 2
Also option --test can be used to specify executed tests:
>itr package.itd.xml --test="/test short name for package/test short name for package 2"
<------------------------------------------------------------------------------
- test full name for package 2                               08:11:41,00
   test full name 1 2                                        08:11:41,00   [ok]
   test full name 2 2                                        08:11:41,01   [ok]
>--------------------------------------------------------------------------[ok]

All the other options aren't so convenient to use from console. They are used for debugging most of the time. If you want to execute complex operation then run
itr package.itd.xml --gui


prevtopnext

SourceForge.net Logo