-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
1,062 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule csptr
updated
from 3b6b26 to 15b825
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,64 @@ | ||
Environment and CLI | ||
=================== | ||
|
||
Tests built with Criterion support environment variables to alter | ||
their runtime behaviour. | ||
Tests built with Criterion expose by default various command line switchs | ||
and environment variables to alter their runtime behaviour. | ||
|
||
Command line arguments | ||
---------------------- | ||
|
||
* ``-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. | ||
* ``--pattern [PATTERN]``: Run tests whose string identifier matches | ||
the given shell wildcard pattern (see dedicated section below). | ||
* ``--no-early-exit``: The test workers shall not prematurely exit when done and | ||
will properly return from the main, cleaning up their process space. | ||
This is useful when tracking memory leaks with ``valgrind --tool=memcheck``. | ||
* ``--always-succeed``: The process shall exit with a status of ``0``. | ||
* ``--tap``: Enables the TAP (Test Anything Protocol) output format. | ||
* ``--verbose[=level]``: Makes the output verbose. When provided with an integer, | ||
sets the verbosity level to that integer. | ||
|
||
Shell Wildcard Pattern | ||
---------------------- | ||
|
||
Patterns in criterion are matched against a test's string identifier with | ||
``fnmatch``. | ||
|
||
Special characters used in shell-style wildcard patterns are: | ||
|
||
=========== =================================== | ||
Pattern Meaning | ||
=========== =================================== | ||
``*`` matches everything | ||
----------- ----------------------------------- | ||
``?`` matches any character | ||
----------- ----------------------------------- | ||
``[seq]`` matches any character in *seq* | ||
----------- ----------------------------------- | ||
``[!seq]`` matches any character not in *seq* | ||
=========== =================================== | ||
|
||
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. | ||
|
||
Environment Variables | ||
--------------------- | ||
|
||
* `CRITERION_ALWAYS_SUCCEED`: when set to `1`, the exit status of the test | ||
process will be 0, regardless if the tests failed or not. | ||
* `CRITERION_NO_EARLY_EXIT`: when set to `1`, the test workers shall not | ||
call `_exit` when done and will properly return from the main and | ||
clean up their process space. This is useful when tracking memory leaks with | ||
`valgrind --tool=memcheck`. | ||
Environment variables are alternatives to command line switches when set to 1. | ||
|
||
* ``CRITERION_ALWAYS_SUCCEED``: Same as ``--always-succeed``. | ||
* ``CRITERION_NO_EARLY_EXIT``: Same as ``--no-early-exit``. | ||
* ``CRITERION_ENABLE_TAP``: Same as ``--tap``. | ||
* ``CRITERION_FAIL_FAST``: Same as ``--fail-fast``. | ||
* ``CRITERION_USE_ASCII``: Same as ``--ascii``. | ||
* ``CRITERION_VERBOSITY_LEVEL``: Same as ``--verbose``. Sets the verbosity level | ||
to its value. | ||
* ``CRITERION_TEST_PATTERN``: Same as ``--pattern``. Sets the test pattern | ||
to its value. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
F.A.Q | ||
===== | ||
|
||
**Q. When running the test suite in Windows' cmd.exe, the test executable | ||
prints weird characters, how do I fix that?** | ||
|
||
A. Windows' ``cmd.exe`` is not an unicode ANSI-compatible terminal emulator. | ||
There are plenty of ways to fix that behaviour: | ||
|
||
* Pass ``--ascii`` to the test suite when executing. | ||
* Define the ``CRITERION_USE_ASCII`` environment variable to ``1``. | ||
* Get a better terminal emulator, such as the one shipped with Git or Cygwin. | ||
|
||
**Q. I'm having an issue with the library, what can I do ?** | ||
|
||
A. Open a new issue on the `github issue tracker <https://github.com/Snaipe/Criterion/issues>`_, | ||
and describe the problem you are experiencing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ Criterion | |
starter | ||
hooks | ||
env | ||
faq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.