summaryrefslogtreecommitdiff
path: root/src/node_binding.cc
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2019-02-08 19:56:08 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2019-02-18 17:37:33 +0800
commit2ae45d3b17f9c51fccffc4041e195e04b4b18c15 (patch)
treea2ce198ab594bc50ba510dcd3be8037ab0dc6eb3 /src/node_binding.cc
parent584dc4893c8c5be0a3c39c0179809e60b774cb95 (diff)
downloadandroid-node-v8-2ae45d3b17f9c51fccffc4041e195e04b4b18c15.tar.gz
android-node-v8-2ae45d3b17f9c51fccffc4041e195e04b4b18c15.tar.bz2
android-node-v8-2ae45d3b17f9c51fccffc4041e195e04b4b18c15.zip
process: start coverage collection before bootstrap
This patch moves the dispatch of `Profiler.takePreciseCoverage` to a point before the bootstrap scripts are run to ensure that we can collect coverage data for all the scripts run after the inspector agent is ready. Before this patch `lib/internal/bootstrap/primordials.js` was not covered by `make coverage`, after this patch it is. PR-URL: https://github.com/nodejs/node/pull/26006 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Coe <bencoe@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_binding.cc')
-rw-r--r--src/node_binding.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/node_binding.cc b/src/node_binding.cc
index 08d55567d4..c9ff7be46f 100644
--- a/src/node_binding.cc
+++ b/src/node_binding.cc
@@ -21,6 +21,12 @@
#define NODE_BUILTIN_REPORT_MODULES(V)
#endif
+#if HAVE_INSPECTOR
+#define NODE_BUILTIN_COVERAGE_MODULES(V) V(coverage)
+#else
+#define NODE_BUILTIN_COVERAGE_MODULES(V)
+#endif
+
// A list of built-in modules. In order to do module registration
// in node::Init(), need to add built-in modules in the following list.
// Then in binding::RegisterBuiltinModules(), it calls modules' registration
@@ -77,7 +83,8 @@
NODE_BUILTIN_STANDARD_MODULES(V) \
NODE_BUILTIN_OPENSSL_MODULES(V) \
NODE_BUILTIN_ICU_MODULES(V) \
- NODE_BUILTIN_REPORT_MODULES(V)
+ NODE_BUILTIN_REPORT_MODULES(V) \
+ NODE_BUILTIN_COVERAGE_MODULES(V)
// This is used to load built-in modules. Instead of using
// __attribute__((constructor)), we call the _register_<modname>