Skip to content

Commit 48224e4

Browse files
cjihrigMylesBorins
authored andcommitted
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: #34751 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 66fcd68 commit 48224e4

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

doc/api/embedding.md

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ the `node` and `v8` C++ namespaces, respectively.
3535

3636
```cpp
3737
int main(int argc, char** argv) {
38+
argv = uv_setup_args(argc, argv);
3839
std::vector<std::string> args(argv, argv + argc);
3940
std::vector<std::string> exec_args;
4041
std::vector<std::string> errors;

test/cctest/gtest/gtest_main.cc

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929

3030
#include <cstdio>
31+
#include <uv.h>
3132
#include "gtest.h"
3233

3334
#ifdef ARDUINO
@@ -40,6 +41,7 @@ void loop() { RUN_ALL_TESTS(); }
4041
#else
4142

4243
GTEST_API_ int main(int argc, char **argv) {
44+
argv = uv_setup_args(argc, argv);
4345
printf("Running main() from %s\n", __FILE__);
4446
testing::InitGoogleTest(&argc, argv);
4547
return RUN_ALL_TESTS();

test/embedding/embedtest.cc

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ static int RunNodeInstance(MultiIsolatePlatform* platform,
2424
const std::vector<std::string>& exec_args);
2525

2626
int main(int argc, char** argv) {
27+
argv = uv_setup_args(argc, argv);
2728
std::vector<std::string> args(argv, argv + argc);
2829
std::vector<std::string> exec_args;
2930
std::vector<std::string> errors;

0 commit comments

Comments
 (0)