Skip to content

Commit 8aa20a3

Browse files
author
Arnd R. Strube
committed
Add documentation for new command-line options
1 parent 6561c9c commit 8aa20a3

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed

manual.markdown

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,20 @@ The test execution of this will *likely* (no guarantee of order in CppUTest) be:
224224

225225
* *-v* verbose, print each test name as it runs
226226
* *-c* colorize output, print green if OK, or red if failed
227-
* *-r#* repeat the tests some number (#) of times, or two times if # is not specified. This is handy if you are experiencing memory leaks. A second run that has no leaks indicates that someone is allocating statics and not releasing them.
228-
* *-g* group only run test whose group contains the substring group
229-
* *-sg* group only run test whose group exactly matches the string group
230-
* *-n* name only run test whose name contains the substring name
231-
* *-sn* name only run test whose name exactly matches the string name
227+
* *-r#* repeat the tests some number (#) of times, or twice if # is not specified. This is handy if you are experiencing memory leaks. A second run that has no leaks indicates that someone is allocating statics and not releasing them.
228+
* *-g group* only run test whose group contains the substring *group*
229+
* *-sg group* only run test whose group exactly matches the string *group*
230+
* *-xg group* exclude tests whose group contains the substring *group*
231+
* *-n name* only run test whose name contains the substring *name*
232+
* *-sn name* only run test whose name exactly matches the string *name*
233+
* *-xn name* exclude tests whose name contains the substring *name*
232234
* *"TEST(group, name)"* only run test whose group and name matches the strings group and name. This can be used to copy-paste output from the -v option on the command line.
233235
* *-ojunit* output to JUnit ant plugin style xml files (for CI systems)
236+
* *-oteamcity* output to xml files (as the name suggests, for TeamCity)
234237
* *-k* package name, Add a package name in JUnit output (for classification in CI systems)
238+
* *-lg* print a list of group names, separated by spaces
239+
* *-ln* print a list of test names in the form of *group.name*, separated by spaces
240+
* *-p* run tests in a separate process.
235241

236242
You can specify multiple -s|sg, -s|sn and "TEST(group, name)" parameters:
237243

@@ -241,6 +247,27 @@ Specifying only test names with multiple -s|sn parameters will run all test
241247

242248
Mixing multiple -s|sg and -s|sn parameters (or using "TEST(group, name)" will only run tests whose groups match as well as their names.
243249

250+
Combining one -xg parameter with one -xn parameter will run only those tests that satisfy both criteria.
251+
252+
Combining -s|sg with -xn, or -s|sn with -xg will run only those tests that satisfy both criteria.
253+
254+
Specifying -xg or -xn in other combinations results in undefined behavior.
255+
256+
*NOTE* Be careful with *-p*:
257+
258+
* Some systems do not support this feature, in which case tests will fail
259+
with a suitable message.
260+
* Using *-p* to run tests in a separate process can have unexpected side
261+
effects.
262+
* While running tests in a separate process can help to get more information
263+
about an unexpected crash, when an expected crash is part of the test scenario,
264+
the *-p* command line option should not be used, but running in a separate
265+
process should be enabled on a per-test basis like this:
266+
{% highlight c++ %}
267+
TestRegistry::getCurrentRegistry()->setRunTestsInSeperateProcess();
268+
{% endhighlight %}
269+
Examples for this can be found in CppUTests's own tests.
270+
244271
<a id="memory_leak_detection"> </a>
245272

246273
## Memory Leak Detection

0 commit comments

Comments
 (0)