the Compartmented Robust Posix C++ Unit Test system | hosted by |
---|
The command line parameters to a test program is:
<programname>
{flags}
{names}
{names}
is zero or more names of tests
or testsuites.
{flags}
are zero or more of:
flag
-c
number
Set number of parallel test case processes to
number
. number
must be a value in the range 1
to
8
inclusively.
crpcut defaults to one child process
With a multi-core CPU, or with tests that spend a lot of time waiting, using many parallel test case processes can considerably shorten the run time of a test program.
![]() | Note |
---|---|
-c cannot be combined with
-s |
-d
dirname
Set the working directory for crpcut to
dirname
. dirname
may be a relative path. The name dirname
must refer to an existing directory that crpcut has write
access to. The tests will run in child directories created by
crpcut
-l
crpcut::run()
prints the names
of all tests matching any in {names}
(or all tests if {names}
is empty) to
the output stream and return -1
.
![]() | Note |
---|---|
-l cannot be combined with any other
option.
|
-n
Ignore all dependencies and consider all tests available for running.
![]() | Note |
---|---|
-n is implied by
-s |
-o
filename
Direct the test report to filename
.
By default the test report will be in XML format. Combine with
-x
to get a
human readable report to filename
. A
report summary will still be printed on stdout
unless suppressed with the
-q
.
![]() | Note |
---|---|
-o cannot be combined with
-s |
-p
name
=value
Define a named parameter for the tests to use. The syntax is
-p
name
=value
.
Several named parameters can be defined with multiple
-p
options on the command line, each
defining a different named parameter.
Tests pick up the values
with crpcut::get_parameter()
.
-q
Suppress the printing of a report summary, resulting from
the -o
filename
option.
![]() | Note |
---|---|
-q is implied by
-s |
-s
Run only one the first test that matches
{names}
, without spawning a separate test
process. This is useful for running a test in a debugger.
![]() | Caution |
---|---|
This is a markedly different environment where many of the
crpcut features are unavailable. stdout and
stderr have their normal functions, instead of
being processed by crpcut.
INFO is sent to stdout.
It is not possible for crpcut to monitor time consumed by the
test case, and neither is it possible to monitor abnormal exits.
|
-v
Include the output from passed tests in the report.
![]() | Note |
---|---|
-v is implied by
-s |
-x
Switch between XML and human readable test report format.
A test report to stdout defaults to human readable, but is
changed to XML using -x
. A test report
to a named file, using
-o
filename
, defaults
to XML but is changed to human readable using
-x
.
![]() | Note |
---|---|
-x cannot be combined with
-s |
Example:
testprog -n -p pwd=`pwd` -x suite_1
Will run all tests in the testsuite suite_1
regardless of dependencies, and will provide the
named parameter
pwd
the name of the current working directory.