Skip to content

Conversation

CurryKitten
Copy link
Contributor

This PR is to support the ongoing efforts of the Nodejs testing workgroup under the following issue nodejs/testing#36 (comment)

Code coverage has currently been implemented by patching files on the fly in order to add in additional compilation options, but this has obvious limitations should the affected riles change in master.

This initial PR implements a --coverage option for the configure script which will then add the necessary cflags/ldflags in node.gyp in order to build node with C++ code coverage on Linux. Obviously, node builds as per normal without the --coverage option specified in configure.

@nodejs-github-bot nodejs-github-bot added the build Issues and PRs related to build files or the CI. label Nov 4, 2016
'-Wl,--whole-archive <(V8_BASE)',
'-Wl,--no-whole-archive' ]
}],
[ '(OS=="freebsd" or OS=="linux") and node_shared=="false" and coverage=="true"', {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does generating coverage on macOS work? Does it need any changes like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@evanlucas I can run coverage on mac, but as the basis of running the CI job is to restrict it to running on Linux-x86, I haven't made any additional changes to support it.

@Fishrock123 Fishrock123 added the c++ Issues and PRs that require attention from people who are familiar with C++. label Nov 4, 2016
Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@mhdawson
Copy link
Member

mhdawson commented Nov 7, 2016

@mhdawson
Copy link
Member

mhdawson commented Nov 7, 2016

Fun on Freebsd to confirm failure is unrelated:
https://ci.nodejs.org/job/node-test-commit-freebsd/5195/

Unless there are any objections before then will plan to land tomorrow.

@mhdawson
Copy link
Member

mhdawson commented Nov 8, 2016

As a note there are other pieces that are needed to generate code coverage results but this is a good first step in order to remove potential conflicts in the nightly runs.

mhdawson pushed a commit that referenced this pull request Nov 8, 2016
Add --coverage option to configure to support
compiling for generation of C based coverage reports

PR-URL: #9463
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@mhdawson
Copy link
Member

mhdawson commented Nov 8, 2016

@CurryKitten for future reference, the title must be limited to 52 characters and have an appropriate prefix. I updated the first commit line as part of landing.

@mhdawson
Copy link
Member

mhdawson commented Nov 8, 2016

landed as 5d9d415

@mhdawson mhdawson closed this Nov 8, 2016
addaleax pushed a commit that referenced this pull request Nov 22, 2016
Add --coverage option to configure to support
compiling for generation of C based coverage reports

PR-URL: #9463
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 13, 2016
Add --coverage option to configure to support
compiling for generation of C based coverage reports

PR-URL: #9463
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 13, 2016
Add --coverage option to configure to support
compiling for generation of C based coverage reports

PR-URL: #9463
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 21, 2016
Add --coverage option to configure to support
compiling for generation of C based coverage reports

PR-URL: #9463
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 21, 2016
Add --coverage option to configure to support
compiling for generation of C based coverage reports

PR-URL: #9463
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
This was referenced Dec 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Issues and PRs related to build files or the CI. c++ Issues and PRs that require attention from people who are familiar with C++.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants