summaryrefslogtreecommitdiff
path: root/doc/guides/writing-tests.md
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2018-06-19 10:31:46 +0200
committerDaniel Bevenius <daniel.bevenius@gmail.com>2018-06-21 13:30:40 +0200
commitb56f65e28c02249359f4f8b682522c7d8d7c5eff (patch)
tree21916557605bab3cd8c728d5e4a3ce8355a58e19 /doc/guides/writing-tests.md
parent883e1cd21d00a1ccf347c543c662b362383e86e0 (diff)
downloadandroid-node-v8-b56f65e28c02249359f4f8b682522c7d8d7c5eff.tar.gz
android-node-v8-b56f65e28c02249359f4f8b682522c7d8d7c5eff.tar.bz2
android-node-v8-b56f65e28c02249359f4f8b682522c7d8d7c5eff.zip
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: https://github.com/nodejs/node/pull/21401 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'doc/guides/writing-tests.md')
-rw-r--r--doc/guides/writing-tests.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/guides/writing-tests.md b/doc/guides/writing-tests.md
index ac2844ebf4..e4a9e296ff 100644
--- a/doc/guides/writing-tests.md
+++ b/doc/guides/writing-tests.md
@@ -403,6 +403,16 @@ The test can be executed by running the `cctest` target:
$ make cctest
```
+A filter can be applied to run single/multiple test cases:
+```console
+$ make cctest GTEST_FILTER=EnvironmentTest.AtExitWithArgument
+```
+
+`cctest` can also be run directly which can be useful when debugging:
+```console
+$ out/Release/cctest --gtest_filter=EnvironmentTest.AtExit*
+```
+
### Node.js test fixture
There is a [test fixture][] named `node_test_fixture.h` which can be included by
unit tests. The fixture takes care of setting up the Node.js environment