mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
test,doc: enable running embedtest for Windows
PR-URL: https://github.com/nodejs/node/pull/52646 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
c137d6eb31
commit
98a1ecfc7b
|
|
@ -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`.
|
* A number of `v8::Context`s, but exactly one main `v8::Context`.
|
||||||
* One `node::IsolateData` instance that contains information that could be
|
* One `node::IsolateData` instance that contains information that could be
|
||||||
shared by multiple `node::Environment`s that use the same `v8::Isolate`.
|
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
|
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
|
to be provided. One possible choice is the default Node.js allocator, which
|
||||||
|
|
|
||||||
1
node.gyp
1
node.gyp
|
|
@ -1248,6 +1248,7 @@
|
||||||
|
|
||||||
'include_dirs': [
|
'include_dirs': [
|
||||||
'src',
|
'src',
|
||||||
|
'tools',
|
||||||
'tools/msvs/genfiles',
|
'tools/msvs/genfiles',
|
||||||
'deps/v8/include',
|
'deps/v8/include',
|
||||||
'deps/cares/include',
|
'deps/cares/include',
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
#undef NDEBUG
|
#undef NDEBUG
|
||||||
#endif
|
#endif
|
||||||
#include "node.h"
|
|
||||||
#include "uv.h"
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include "executable_wrapper.h"
|
||||||
|
#include "node.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
|
@ -27,8 +27,10 @@ static int RunNodeInstance(MultiIsolatePlatform* platform,
|
||||||
const std::vector<std::string>& args,
|
const std::vector<std::string>& args,
|
||||||
const std::vector<std::string>& exec_args);
|
const std::vector<std::string>& exec_args);
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
NODE_MAIN(int argc, node::argv_type raw_argv[]) {
|
||||||
argv = uv_setup_args(argc, argv);
|
char** argv = nullptr;
|
||||||
|
node::FixupMain(argc, raw_argv, &argv);
|
||||||
|
|
||||||
std::vector<std::string> args(argv, argv + argc);
|
std::vector<std::string> args(argv, argv + argc);
|
||||||
std::shared_ptr<node::InitializationResult> result =
|
std::shared_ptr<node::InitializationResult> result =
|
||||||
node::InitializeOncePerProcess(
|
node::InitializeOncePerProcess(
|
||||||
|
|
@ -106,7 +108,7 @@ int RunNodeInstance(MultiIsolatePlatform* platform,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!snapshot_blob_path.empty() && !is_building_snapshot) {
|
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);
|
assert(fp != nullptr);
|
||||||
if (snapshot_as_file) {
|
if (snapshot_as_file) {
|
||||||
snapshot = node::EmbedderSnapshotData::FromFile(fp);
|
snapshot = node::EmbedderSnapshotData::FromFile(fp);
|
||||||
|
|
@ -204,7 +206,7 @@ int RunNodeInstance(MultiIsolatePlatform* platform,
|
||||||
snapshot = setup->CreateSnapshot();
|
snapshot = setup->CreateSnapshot();
|
||||||
assert(snapshot);
|
assert(snapshot);
|
||||||
|
|
||||||
FILE* fp = fopen(snapshot_blob_path.c_str(), "w");
|
FILE* fp = fopen(snapshot_blob_path.c_str(), "wb");
|
||||||
assert(fp != nullptr);
|
assert(fp != nullptr);
|
||||||
if (snapshot_as_file) {
|
if (snapshot_as_file) {
|
||||||
snapshot->ToFile(fp);
|
snapshot->ToFile(fp);
|
||||||
|
|
|
||||||
|
|
@ -333,6 +333,7 @@ if "%target%"=="Build" (
|
||||||
if defined cctest set 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%\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%"
|
if defined msbuild_args set "extra_msbuild_args=%extra_msbuild_args% %msbuild_args%"
|
||||||
@rem Setup env variables to use multiprocessor build
|
@rem Setup env variables to use multiprocessor build
|
||||||
set UseMultiToolTask=True
|
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%'
|
echo running 'cctest %cctest_args%'
|
||||||
"%config%\cctest" %cctest_args%
|
"%config%\cctest" %cctest_args%
|
||||||
if %errorlevel% neq 0 set exit_code=%errorlevel%
|
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
|
:run-test-py
|
||||||
echo running 'python tools\test.py %test_args%'
|
echo running 'python tools\test.py %test_args%'
|
||||||
python tools\test.py %test_args%
|
python tools\test.py %test_args%
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user