2015-02-11 14:22:49 +01:00
|
|
|
Environment and CLI
|
|
|
|
===================
|
|
|
|
|
2015-03-18 07:10:17 +01:00
|
|
|
Tests built with Criterion expose by default various command line switchs
|
|
|
|
and environment variables to alter their runtime behaviour.
|
|
|
|
|
|
|
|
Command line arguments
|
|
|
|
----------------------
|
|
|
|
|
2015-03-23 14:46:14 +01:00
|
|
|
* ``-h or --help``: Show a help message with the available switches.
|
|
|
|
* ``-v or --version``: Prints the version of criterion that has been
|
|
|
|
linked against.
|
|
|
|
* ``-l or --list``: Print all the tests in a list.
|
|
|
|
* ``-f or --fail-fast``: Exit after the first test failure.
|
|
|
|
* ``--ascii``: Don't use fancy unicode symbols or colors in the output.
|
2015-09-23 02:11:06 +02:00
|
|
|
* ``-jN or --jobs N``: Use ``N`` parallel jobs to run the tests. ``0`` picks
|
|
|
|
a number of jobs ideal for your hardware configuration.
|
2015-03-23 14:46:14 +01:00
|
|
|
* ``--pattern [PATTERN]``: Run tests whose string identifier matches
|
2015-04-14 14:53:18 +02:00
|
|
|
the given shell wildcard pattern (see dedicated section below). (\*nix only)
|
2015-03-23 14:46:14 +01:00
|
|
|
* ``--no-early-exit``: The test workers shall not prematurely exit when done and
|
2015-03-18 07:10:17 +01:00
|
|
|
will properly return from the main, cleaning up their process space.
|
2015-03-23 14:46:14 +01:00
|
|
|
This is useful when tracking memory leaks with ``valgrind --tool=memcheck``.
|
2015-08-20 20:39:28 +02:00
|
|
|
* ``-S or --short-filename``: The filenames are displayed in their short form.
|
2015-03-23 14:46:14 +01:00
|
|
|
* ``--always-succeed``: The process shall exit with a status of ``0``.
|
|
|
|
* ``--tap``: Enables the TAP (Test Anything Protocol) output format.
|
2015-10-05 16:26:25 +02:00
|
|
|
* ``--xml``: Enables the JUnit4 XML output format.
|
2015-03-23 14:46:14 +01:00
|
|
|
* ``--verbose[=level]``: Makes the output verbose. When provided with an integer,
|
2015-03-18 07:10:17 +01:00
|
|
|
sets the verbosity level to that integer.
|
2015-02-11 14:22:49 +01:00
|
|
|
|
2015-03-23 14:46:14 +01:00
|
|
|
Shell Wildcard Pattern
|
|
|
|
----------------------
|
|
|
|
|
2015-09-23 02:19:11 +02:00
|
|
|
Extglob patterns in criterion are matched against a test's string identifier.
|
|
|
|
This feature is only available on \*nix systems where ``PCRE`` is provided.
|
|
|
|
|
|
|
|
In the table below, a ``pattern-list`` is a list of patterns separated by ``|``.
|
|
|
|
Any extglob pattern can be constructed by combining any of the following
|
|
|
|
sub-patterns:
|
|
|
|
|
|
|
|
==================== ======================================================
|
|
|
|
Pattern Meaning
|
|
|
|
==================== ======================================================
|
|
|
|
``*`` matches everything
|
|
|
|
-------------------- ------------------------------------------------------
|
|
|
|
``?`` matches any character
|
|
|
|
-------------------- ------------------------------------------------------
|
|
|
|
``[seq]`` matches any character in *seq*
|
|
|
|
-------------------- ------------------------------------------------------
|
|
|
|
``[!seq]`` matches any character not in *seq*
|
|
|
|
-------------------- ------------------------------------------------------
|
|
|
|
``?(pattern-list)`` Matches zero or one occurrence of the given patterns
|
|
|
|
-------------------- ------------------------------------------------------
|
|
|
|
``*(pattern-list)`` Matches zero or more occurrences of the given patterns
|
|
|
|
-------------------- ------------------------------------------------------
|
|
|
|
``+(pattern-list)`` Matches one or more occurrences of the given patterns
|
|
|
|
-------------------- ------------------------------------------------------
|
|
|
|
``@(pattern-list)`` Matches one of the given patterns
|
|
|
|
-------------------- ------------------------------------------------------
|
|
|
|
``!(pattern-list)`` Matches anything except one of the given patterns
|
|
|
|
==================== ======================================================
|
2015-03-23 14:46:14 +01:00
|
|
|
|
|
|
|
A test string identifier is of the form ``suite-name/test-name``, so a pattern
|
|
|
|
of ``simple/*`` matches every tests in the ``simple`` suite, ``*/passing``
|
|
|
|
matches all tests named ``passing`` regardless of the suite, and ``*`` matches
|
|
|
|
every possible test.
|
|
|
|
|
2015-02-11 14:22:49 +01:00
|
|
|
Environment Variables
|
|
|
|
---------------------
|
|
|
|
|
2015-03-18 07:10:17 +01:00
|
|
|
Environment variables are alternatives to command line switches when set to 1.
|
|
|
|
|
2015-03-23 14:46:14 +01:00
|
|
|
* ``CRITERION_ALWAYS_SUCCEED``: Same as ``--always-succeed``.
|
|
|
|
* ``CRITERION_NO_EARLY_EXIT``: Same as ``--no-early-exit``.
|
|
|
|
* ``CRITERION_ENABLE_TAP``: Same as ``--tap``.
|
2015-10-05 16:26:25 +02:00
|
|
|
* ``CRITERION_ENABLE_XML``: Same as ``--xml``.
|
2015-03-23 14:46:14 +01:00
|
|
|
* ``CRITERION_FAIL_FAST``: Same as ``--fail-fast``.
|
|
|
|
* ``CRITERION_USE_ASCII``: Same as ``--ascii``.
|
2015-09-23 02:11:06 +02:00
|
|
|
* ``CRITERION_JOBS``: Same as ``jobs``. Sets the number of jobs to
|
|
|
|
its value.
|
2015-08-20 20:39:28 +02:00
|
|
|
* ``CRITERION_SHORT_FILENAME``: Same as ``--short-filename``.
|
2015-03-23 14:46:14 +01:00
|
|
|
* ``CRITERION_VERBOSITY_LEVEL``: Same as ``--verbose``. Sets the verbosity level
|
|
|
|
to its value.
|
|
|
|
* ``CRITERION_TEST_PATTERN``: Same as ``--pattern``. Sets the test pattern
|
2015-04-14 14:53:18 +02:00
|
|
|
to its value. (\*nix only)
|