diff --git a/doc/api/embedding.md b/doc/api/embedding.md index 9f831b342c2705..d4ae090c255f97 100644 --- a/doc/api/embedding.md +++ b/doc/api/embedding.md @@ -90,7 +90,7 @@ to as `node::Environment`. Each `node::Environment` is associated with: * A number of `v8::Context`s, but exactly one main `v8::Context`. * One `node::IsolateData` instance that contains information that could be shared by multiple `node::Environment`s that use the same `v8::Isolate`. - Currently, no testing if performed for this scenario. + Currently, no testing is performed for this scenario. In order to set up a `v8::Isolate`, an `v8::ArrayBuffer::Allocator` needs to be provided. One possible choice is the default Node.js allocator, which diff --git a/node.gyp b/node.gyp index d4f25b3ef2d11a..8478201831c997 100644 --- a/node.gyp +++ b/node.gyp @@ -1248,6 +1248,7 @@ 'include_dirs': [ 'src', + 'tools', 'tools/msvs/genfiles', 'deps/v8/include', 'deps/cares/include', diff --git a/test/embedding/embedtest.cc b/test/embedding/embedtest.cc index 741ee6fcad44f9..559a31a96af008 100644 --- a/test/embedding/embedtest.cc +++ b/test/embedding/embedtest.cc @@ -1,9 +1,9 @@ #ifdef NDEBUG #undef NDEBUG #endif -#include "node.h" -#include "uv.h" #include +#include "executable_wrapper.h" +#include "node.h" #include @@ -27,8 +27,10 @@ static int RunNodeInstance(MultiIsolatePlatform* platform, const std::vector& args, const std::vector& exec_args); -int main(int argc, char** argv) { - argv = uv_setup_args(argc, argv); +NODE_MAIN(int argc, node::argv_type raw_argv[]) { + char** argv = nullptr; + node::FixupMain(argc, raw_argv, &argv); + std::vector args(argv, argv + argc); std::shared_ptr result = node::InitializeOncePerProcess( @@ -106,7 +108,7 @@ int RunNodeInstance(MultiIsolatePlatform* platform, } if (!snapshot_blob_path.empty() && !is_building_snapshot) { - FILE* fp = fopen(snapshot_blob_path.c_str(), "r"); + FILE* fp = fopen(snapshot_blob_path.c_str(), "rb"); assert(fp != nullptr); if (snapshot_as_file) { snapshot = node::EmbedderSnapshotData::FromFile(fp); @@ -204,7 +206,7 @@ int RunNodeInstance(MultiIsolatePlatform* platform, snapshot = setup->CreateSnapshot(); assert(snapshot); - FILE* fp = fopen(snapshot_blob_path.c_str(), "w"); + FILE* fp = fopen(snapshot_blob_path.c_str(), "wb"); assert(fp != nullptr); if (snapshot_as_file) { snapshot->ToFile(fp); diff --git a/vcbuild.bat b/vcbuild.bat index d618930059646c..8a72e50cb494fe 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -333,6 +333,7 @@ if "%target%"=="Build" ( if defined cctest set target="Build" ) if "%target%"=="node" if exist "%config%\cctest.exe" del "%config%\cctest.exe" +if "%target%"=="node" if exist "%config%\embedtest.exe" del "%config%\embedtest.exe" if defined msbuild_args set "extra_msbuild_args=%extra_msbuild_args% %msbuild_args%" @rem Setup env variables to use multiprocessor build set UseMultiToolTask=True @@ -675,6 +676,9 @@ if not exist "%config%\cctest.exe" echo cctest.exe not found. Run "vcbuild test" echo running 'cctest %cctest_args%' "%config%\cctest" %cctest_args% if %errorlevel% neq 0 set exit_code=%errorlevel% +echo running '%node_exe% test\embedding\test-embedding.js' +"%node_exe%" test\embedding\test-embedding.js +if %errorlevel% neq 0 set exit_code=%errorlevel% :run-test-py echo running 'python tools\test.py %test_args%' python tools\test.py %test_args%