From 26ede7f295ed3edde04bb55131b1a1a3ab7f2423 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Wed, 12 Aug 2020 14:35:40 -0400 Subject: [PATCH] test,doc: add missing uv_setup_args() calls libuv 1.39.0 will begin requiring uv_setup_args() to be called before attempting to access the process title. This commit adds uv_setup_args() calls that were missing in order for the test suite to pass (and updates the documentation). Backport-PR-URL: https://github.com/nodejs/node/pull/35241 PR-URL: https://github.com/nodejs/node/pull/34751 Reviewed-By: Richard Lau Reviewed-By: David Carlier Reviewed-By: Rich Trott --- doc/api/embedding.md | 1 + test/cctest/gtest/gtest_main.cc | 2 ++ test/embedding/embedtest.cc | 1 + 3 files changed, 4 insertions(+) diff --git a/doc/api/embedding.md b/doc/api/embedding.md index f1ab0db5a5329d..f700a926cc3447 100644 --- a/doc/api/embedding.md +++ b/doc/api/embedding.md @@ -35,6 +35,7 @@ the `node` and `v8` C++ namespaces, respectively. ```cpp int main(int argc, char** argv) { + argv = uv_setup_args(argc, argv); std::vector args(argv, argv + argc); std::vector exec_args; std::vector errors; diff --git a/test/cctest/gtest/gtest_main.cc b/test/cctest/gtest/gtest_main.cc index 1ed4df287834d5..345044407a499a 100644 --- a/test/cctest/gtest/gtest_main.cc +++ b/test/cctest/gtest/gtest_main.cc @@ -28,6 +28,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include +#include #include "gtest.h" #ifdef ARDUINO @@ -40,6 +41,7 @@ void loop() { RUN_ALL_TESTS(); } #else GTEST_API_ int main(int argc, char **argv) { + argv = uv_setup_args(argc, argv); printf("Running main() from %s\n", __FILE__); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); diff --git a/test/embedding/embedtest.cc b/test/embedding/embedtest.cc index 366c8f12e2c11f..c2e98875c09a15 100644 --- a/test/embedding/embedtest.cc +++ b/test/embedding/embedtest.cc @@ -24,6 +24,7 @@ static int RunNodeInstance(MultiIsolatePlatform* platform, const std::vector& exec_args); int main(int argc, char** argv) { + argv = uv_setup_args(argc, argv); std::vector args(argv, argv + argc); std::vector exec_args; std::vector errors;