catch3
Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.
Clonegit clone https://git.progmasoft.com/catch3
Updated command line docs with info on -c for running sections, as well as -# for filenames as tags
- Commit
1a3f6d829baaf45d79c63632f0668bec157930c4- Author
- Phil Nash ·
- Parents
b524fa7cd8d0
Changes
docs/command-line.md | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/docs/command-line.md b/docs/command-line.md index c39122d6..3b8f1816 100644 --- a/docs/command-line.md +++ b/docs/command-line.md @@ -17,6 +17,9 @@ Click one of the followings links to take you straight to that option - or scrol <a href="#warnings"> ` -w, --warn`</a><br /> <a href="#reporting-timings"> ` -d, --durations`</a><br /> <a href="#input-file"> ` -f, --input-file`</a><br /> +<a href="#run-section"> ` -c, --section`</a><br /> +<a href="#filenames-as-tags"> ` -#, --filenames-as-tags`</a><br /> + </br> @@ -217,6 +220,59 @@ In either case the actual value for the seed is printed as part of Catch's outpu Prints the command line arguments to stdout + +<a id="run-section"></a> +## Specify the section to run +<pre>-s, --section <section name></pre> + +To limit exection to a specific section within a test case, use this option one or more times. +To narrow to sub-sections use multiple instances, where each subsequent instance specifies a deeper nesting level. + +E.g. if you have: + +<pre> +TEST_CASE( "Test" ) { + SECTION( "sa" ) { + SECTION( "sb" ) { + /*...*/ + } + SECTION( "sc" ) { + /*...*/ + } + } + SECTION( "sd" ) { + /*...*/ + } +} +</pre> + +Then you can run `sb` with: +<pre>./MyExe Test -c sa -c sb</pre> + +Or run just `sd` with: +<pre>./MyExe Test -c sd</pre> + +To run all of `sa`, including `sb` and `sc` use: +<pre>./MyExe Test -c sa</pre> + +There are some limitations of this feature to be aware of: +- Code outside of sections being skipped will still be executed - e.g. any set-up code in the TEST_CASE before the +start of the first section.</br> +- At time of writing, wildcards are not supported in section names. +- If you specify a section without narrowing to a test case first then all test cases will be executed +(but only matching sections within them). + + +<a id="filenames-as-tags"></a> +## Filenames as tags +<pre>-#, --filenames-as-tags</pre> + +When this option is used then every test is given an additional tag which is formed of the unqualified +filename it is found in, with any extension stripped, prefixed with the `#` character. + +So, for example, tests within the file `~\Dev\MyProject\Ferrets.cpp` would be tagged `[#Ferrets]`. + + --- [Home](Readme.md)