Skip to content

Commit

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

PR-URL: nodejs#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 committed Sep 23, 2020
1 parent 93a23b9 commit 72f42bf
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 @@ -73,11 +73,13 @@ class NodeTestFixture : 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 72f42bf

Please sign in to comment.