diff options
Diffstat (limited to 'BUILDING.md')
-rw-r--r-- | BUILDING.md | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/BUILDING.md b/BUILDING.md index d208965c7c1..f339a20e31b 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. |