From b56f65e28c02249359f4f8b682522c7d8d7c5eff Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 19 Jun 2018 10:31:46 +0200 Subject: [PATCH] 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 --- doc/guides/writing-tests.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/guides/writing-tests.md b/doc/guides/writing-tests.md index ac2844ebf43..e4a9e296ff4 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