Skip to content

Commit e944749

Browse files
danbevtargos
authored andcommitted
doc: add example of using filter with cctest
This commit adds examples of specifying filters when running cctest. This can be useful when debugging and limiting the test cases run to the test cases of interest and I think worth documenting. PR-URL: #21401 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 5cd78ba commit e944749

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

doc/guides/writing-tests.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,16 @@ The test can be executed by running the `cctest` target:
403403
$ make cctest
404404
```
405405

406+
A filter can be applied to run single/multiple test cases:
407+
```console
408+
$ make cctest GTEST_FILTER=EnvironmentTest.AtExitWithArgument
409+
```
410+
411+
`cctest` can also be run directly which can be useful when debugging:
412+
```console
413+
$ out/Release/cctest --gtest_filter=EnvironmentTest.AtExit*
414+
```
415+
406416
### Node.js test fixture
407417
There is a [test fixture][] named `node_test_fixture.h` which can be included by
408418
unit tests. The fixture takes care of setting up the Node.js environment

0 commit comments

Comments
 (0)