Skip to content

Commit

Permalink
test,doc: add missing uv_setup_args() calls
Browse files Browse the repository at this point in the history
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 <riclau@uk.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
cjihrig authored and BethGriggs committed Aug 20, 2020
1 parent 3925fd6 commit 5009d82
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/api/embedding.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions test/cctest/gtest/gtest_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
Expand Down
1 change: 1 addition & 0 deletions test/embedding/embedtest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5009d82

Please sign in to comment.