summaryrefslogtreecommitdiff
path: root/BUILDING.md
diff options
context:
space:
mode:
authorbcoe <bencoe@google.com>2020-10-22 19:56:28 -0700
committerBenjamin Coe <bencoe@google.com>2020-10-25 07:22:57 -0700
commitba907ff750ea18df743252b09f2c29d35ebe285d (patch)
treef110f5384e46eb2f1d95d74b59f4bf08eb14817b /BUILDING.md
parentbae7ddecf709aa9c2c10d511ccecb3c13242471c (diff)
downloadios-node-v8-ba907ff750ea18df743252b09f2c29d35ebe285d.tar.gz
ios-node-v8-ba907ff750ea18df743252b09f2c29d35ebe285d.tar.bz2
ios-node-v8-ba907ff750ea18df743252b09f2c29d35ebe285d.zip
test: refactor coverage logic
Cleanup logic in Makefile for coverage. Update BUILDING.md accordingly. PR-URL: https://github.com/nodejs/node/pull/35767 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'BUILDING.md')
-rw-r--r--BUILDING.md32
1 files changed, 18 insertions, 14 deletions
diff --git a/BUILDING.md b/BUILDING.md
index d208965c7c..f339a20e31 100644
--- a/BUILDING.md
+++ b/BUILDING.md
@@ -389,28 +389,32 @@ $ make coverage
```
A detailed coverage report will be written to `coverage/index.html` for
-JavaScript coverage and to `coverage/cxxcoverage.html` for C++ coverage
-(if you only want to run the JavaScript tests then you do not need to run
-the first command `./configure --coverage`).
+JavaScript coverage and to `coverage/cxxcoverage.html` for C++ coverage.
-_Generating a test coverage report can take several minutes._
-
-To collect coverage for a subset of tests you can set the `CI_JS_SUITES` and
-`CI_NATIVE_SUITES` variables (to run specific suites, e.g., `child-process`, in
-isolation, unset the opposing `_SUITES` variable):
+If you only want to run the JavaScript tests then you do not need to run
+the first command (`./configure --coverage`). Run `make coverage-run-js`,
+to execute JavaScript tests independently of the C++ test suite:
```text
-$ CI_JS_SUITES=child-process CI_NATIVE_SUITES= make coverage
+$ make coverage-run-js
```
-The above command executes tests for the `child-process` subsystem and
-outputs the resulting coverage report.
+If you are updating tests and want to collect coverrage for a single test file
+(e.g. `test/parallel/test-stream2-transform.js`):
+
+```text
+$ make coverage-clean
+$ NODE_V8_COVERAGE=coverage/tmp python tools/test.py test/parallel/test-stream2-transform.js
+$ make coverage-report-js
+```
-Alternatively, you can run `make coverage-run-js`, to execute JavaScript tests
-independently of the C++ test suite:
+You can collect coverage for the entire suite of tests for a given subsystem
+by providing the name of a subsystem:
```text
-$ CI_JS_SUITES=fs CI_NATIVE_SUITES= make coverage-run-js
+$ make coverage-clean
+$ NODE_V8_COVERAGE=coverage/tmp python tools/test.py -J --mode=release child-process
+$ make coverage-report-js
```
The `make coverage` command downloads some tools to the project root directory.