Skip to content

Commit

Permalink
test: use InitializeNodeWithArgs in cctest
Browse files Browse the repository at this point in the history
Refs: d7f1107
Fixes: #30257

PR-URL: #32406
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Matheus Marchini <[email protected]>
Reviewed-By: David Carlier <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
addaleax authored and mmarchini committed Mar 23, 2020
1 parent 6b5f82d commit f2cc28a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/cctest/node_test_fixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,13 @@ class NodeZeroIsolateTestFixture : public ::testing::Test {
if (!node_initialized) {
uv_os_unsetenv("NODE_OPTIONS");
node_initialized = true;
int argc = 1;
const char* argv0 = "cctest";
int exec_argc;
const char** exec_argv;
node::Init(&argc, &argv0, &exec_argc, &exec_argv);
std::vector<std::string> argv { "cctest" };
std::vector<std::string> exec_argv;
std::vector<std::string> errors;

int exitcode = node::InitializeNodeWithArgs(&argv, &exec_argv, &errors);
CHECK_EQ(exitcode, 0);
CHECK(errors.empty());
}

tracing_agent = std::make_unique<node::tracing::Agent>();
Expand Down

0 comments on commit f2cc28a

Please sign in to comment.