mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-10 08:04:44 +02:00
Updated test case option
@@ -5,16 +5,16 @@ Note that options are described according to the following pattern:
|
||||
|
||||
*<description>*
|
||||
|
||||
<a href="#usage"> <pre>-h, -?, --help</pre></a>
|
||||
<a href="#nothrow"> <pre>-n, --nothrow</pre></a>
|
||||
<a href="#test"> <pre>-t, --test</pre></a>
|
||||
<a href="#reporter"> <pre>-r, --reporter</pre></a>
|
||||
<a href="#break"> <pre>-b, --break</pre></a>
|
||||
<a href="#success"> <pre>-s, --success</pre></a>
|
||||
<a href="#abort"> <pre>-a, --abort</pre></a>
|
||||
<a href="#list"> <pre>-l, --list</pre></a>
|
||||
<a href="#output"> <pre>-o, --out</pre></a>
|
||||
<a href="#name"> <pre>-n, --name</pre></a>
|
||||
<a href="#usage"> `-h, -?, --help`</a><br />
|
||||
<a href="#nothrow"> `-n, --nothrow`</a><br />
|
||||
<a href="#test"> `-t, --test`</a><br />
|
||||
<a href="#reporter"> `-r, --reporter`</a><br />
|
||||
<a href="#break"> `-b, --break`</a><br />
|
||||
<a href="#success"> `-s, --success`</a><br />
|
||||
<a href="#abort"> `-a, --abort`</a><br />
|
||||
<a href="#list"> `-l, --list`</a><br />
|
||||
<a href="#output"> `-o, --out`</a><br />
|
||||
<a href="#name"> `-n, --name`</a><br />
|
||||
|
||||
<a name="usage" />
|
||||
## Usage
|
||||
@@ -31,13 +31,32 @@ Prints the command line arguments to stdout
|
||||
-t, --test <test-spec> [<test-spec> ...]
|
||||
</pre>
|
||||
|
||||
If you don't specify any tests on the command line then all registered tests are run.
|
||||
Alternatively use -t or --test to specify which tests to run. This option takes 1-n arguments (you can also supply the option as many times as you like), each of which specify a test case name or a pattern that matches any number of test case names. In general these are referred to as test specs. Quotes are optional for test specs, unless there are spaces - in which case they are required. Some examples:
|
||||
This option allows one ore more test specs to be supplied. Each spec either fully specifies a
|
||||
test case or is a pattern containing wildcards to match a set of test cases. If this option
|
||||
is not provided then all test cases, except those prefixed by `'./'` are run
|
||||
|
||||
Specs must be enclosed in "quotes" if they contain spaces. If they do not contain spaces
|
||||
the quotes are optional.
|
||||
|
||||
Wildcards consist of the * character at the beginning, end, or both and can substitute for
|
||||
any number of any characters (including none)
|
||||
|
||||
If spec is prefixed with `exclude:` or the `~` character then the pattern matches an exclusion.
|
||||
This means that tests matching the pattern are excluded from the set - even if a prior
|
||||
inclusion spec included them. Subsequent inclusion specs will take precendence, however.
|
||||
Inclusions and exclusions are evaluated in left-to-right order.
|
||||
|
||||
Examples:
|
||||
|
||||
<pre>
|
||||
-t "example/first test"
|
||||
-t example/stupid example/silly
|
||||
-t example/group/*
|
||||
-t thisTestOnly Matches the test case called, 'thisTestOnly'
|
||||
-t "this test only" Matches the test case called, 'this test only'
|
||||
-t these/* Matches all cases starting with 'these/'
|
||||
-t exclude:notThis Matches all tests except, 'notThis'
|
||||
-t ~:notThis Matches all tests except, 'notThis'
|
||||
-t ~*private* Matches all tests except those that contain 'private'
|
||||
-t a/* ~a/b/* a/b/c Matches all tests that start with 'a/', except those that
|
||||
start with 'a/b/', except 'a/b/c', which is included
|
||||
</pre>
|
||||
|
||||
<a name="reporter" />
|
||||
|
Reference in New Issue
Block a user