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).

PR-URL: https://github.com/nodejs/node/pull/34751
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
cjihrig authored and Rich Trott committed 2020-08-14 15:29:29 -07:00
1 parent 8640cd6066
commit 1e59f31555
3 files changed
+4

No files matched your search

+1
View File
@@ -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<std::string> args(argv, argv + argc);
std::vector<std::string> exec_args;
std::vector<std::string> errors;
+2
View File
@@ -28,6 +28,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <cstdio>
#include <uv.h>
#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();
+1
View File
@@ -24,6 +24,7 @@ static int RunNodeInstance(MultiIsolatePlatform* platform,
const std::vector<std::string>& exec_args);
int main(int argc, char** argv) {
argv = uv_setup_args(argc, argv);
std::vector<std::string> args(argv, argv + argc);
std::vector<std::string> exec_args;
std::vector<std::string> errors;