Introduction
===========================
This console application helps in testing other console applications
by checking the output agains specific rules specified by the
user as regular expressions. Check home page[2] for updates and
latest news.
The application expects as arguments one or more control files
that consist of commands. Each line is interpreted and
compared against a list of known commands. Comments must
stay on their own line and should start with a # sign.
The documentation uses the term target to refer to a program that
is being tested. To create a new target use the TARGET command.
To change current target use the SWITCH command. Targets are
discarded only at the end of the program. If you do not
check explicitly for program exit using END TARGET or EXIT CODE,
the program will check this itself at the end. Finding a target
still running at this point is considered to be a failed test.
List of build-in commands:
INCLUDE <file>
includes another file; the file is interpreted before
stepping to next line.
TARGET [path/]<name> [ARGS <arguments>]
starts a program identified by path and name and provides
the arguments to it. Failing to find the program
is considered an error.
SWITCH <name>
changes current target to the one identified by the <name>.
This string must be the same one that was provided to
TARGET command. If the name is not found is considered to be
an error.
END TARGET [name]
chacks the target to see if it ended its execution.
The target is either the current target (if no name was specified)
or the one that is indicated by the name.
If the target has ended this counts as a successful test,
otherwise it counts as a failed test.
EXIT CODE <code>
EXIT CODE NOT <code>
checks if the current target ended its execution and
with what code.
COMMAND <cmd>
sends the string (and an ending new line character) to the program.
EXPECT <pattern>
EXPECTE <pattern>
EXPECTO <pattern>
checks the output of the program against provided regular expression.
EXPECT checks both standard output and standard error chanels,
while EXPECTE and EXPECTO check only specific chanels.
Note that the coresponding output buffer is cleared after these commands.
The commands are case-insensitive, but always presented as Uppercase
in documentation.
Getting the package
===========================
The program uses Git as VCM. To get the source code use folloing command:
git clone git://git.code.sf.net/p/cmdtest/code cmd-test-trunk
Precompiled packages are available at download page[3]
Licence
===========================
The project is distributed under the 3-clause license
("Revised BSD License", "New BSD License", or
"Modified BSD License") [1]. Read about it in the COPYING file.
Instalation
===========================
To build and install the library follow the instructions in INSTALL file.
Content of the package
===========================
debian (directory)
contains the files that are used to generate debian distributions.
distrib (directory)
this is where the distributions are generated. It is not part of the source
distribution.
cmd-test (directory)
groups the C++ source files and headers
test-files (directory)
several files to exemplify and test the functionality of this program
tools (directory)
various helper files
[1] http://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_.28.22Revised_BSD_License.22.2C_.22New_BSD_License.22.2C_or_.22Modified_BSD_License.22.29
[2] http://cmdtest.sourceforge.net/
[3] http://sourceforge.net/projects/cmdtest/files/