Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions doc/contributing/writing-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,19 +430,21 @@ static void at_exit_callback(void* arg) {
}
```

Next add the test to the `sources` in the `cctest` target in node.gyp:
There is no need to list the file anywhere: `configure.py` collects every `.cc`
and `.h` file under `test/cctest` into the `node_cctest_sources` variable that
the `cctest` target in node.gyp builds.

```console
'sources': [
'test/cctest/test_env.cc',
...
],
```
If the test can only be built when a given feature is enabled, add it to the
matching variable in node.gyp so that it is excluded from the build otherwise:

* `node_cctest_openssl_sources` for tests that require crypto support
* `node_cctest_quic_sources` for tests that require QUIC support
* `node_cctest_inspector_sources` for tests that require the inspector

The only sources that should be included in the cctest target are
actual test or helper source files. There might be a need to include specific
object files that are compiled by the `node` target and this can be done by
adding them to the `libraries` section in the cctest target.
The only sources that should be placed in `test/cctest` are actual test or
helper source files. There might be a need to include specific object files
that are compiled by the `node` target and this can be done by adding them to
the `libraries` section in the cctest target.

The test can be executed by running the `cctest` target:

Expand Down
Loading