Skip to content

Commit 7f5bcbd

Browse files
kunalspathakaddaleax
authored andcommitted
build,test: run v8 tests on windows
`vcbuild.bat test-v8` : Runs unit test from v8 repo `vcbuild.bat test-v8-intl` : Runs intl test from v8 repo `vcbuild.bat test-v8` : Runs benchmarks from v8 repo The runs needs https://www.chromium.org/developers/how-tos/install-depot-tools installed on the machine expects environment variable `DEPOT_TOOLS_PATH` to be set to the path. Set environment variable `DISABLE_V8_I18N` to disable i18n. PR-URL: #13992 Refs: #4704 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
1 parent 60e0f2b commit 7f5bcbd

File tree

2 files changed

+60
-2
lines changed

2 files changed

+60
-2
lines changed

tools/test-v8.bat

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
if not defined DEPOT_TOOLS_PATH goto depot-tools-not-found
2+
if "%config%"=="Debug" set test_args=%target_arch%.debug
3+
if "%config%"=="Release" set test_args=%target_arch%.release
4+
set savedpath=%path%
5+
set path=%DEPOT_TOOLS_PATH%;%path%
6+
pushd .
7+
8+
set ERROR_STATUS=0
9+
echo calling: tools\make-v8.sh
10+
sh tools\make-v8.sh
11+
if errorlevel 1 set ERROR_STATUS=1&goto test-v8-exit
12+
cd %~dp0
13+
cd deps\v8
14+
echo running 'python tools\dev\v8gen.py %test_args%'
15+
call python tools\dev\v8gen.py %test_args%
16+
if errorlevel 1 set ERROR_STATUS=1&goto test-v8-exit
17+
echo running 'ninja -C out.gn/%test_args% %v8_build_options%'
18+
call ninja -C out.gn/%test_args% %v8_build_options%
19+
if errorlevel 1 set ERROR_STATUS=1&goto test-v8-exit
20+
set path=%savedpath%
21+
22+
if not defined test_v8 goto test-v8-intl
23+
echo running 'python tools\run-tests.py %common_v8_test_options% %v8_test_options% --junitout ./v8-tap.xml'
24+
call python tools\run-tests.py %common_v8_test_options% %v8_test_options% --junitout ./v8-tap.xml
25+
26+
:test-v8-intl
27+
if not defined test_v8_intl goto test-v8-benchmarks
28+
echo running 'python tools\run-tests.py %common_v8_test_options% intl --junitout ./v8-intl-tap.xml'
29+
call python tools\run-tests.py %common_v8_test_options% intl --junitout ./v8-intl-tap.xml
30+
31+
:test-v8-benchmarks
32+
if not defined test_v8_benchmarks goto test-v8-exit
33+
echo running 'python tools\run-tests.py %common_v8_test_options% benchmarks --junitout ./v8-benchmarks-tap.xml'
34+
call python tools\run-tests.py %common_v8_test_options% benchmarks --junitout ./v8-benchmarks-tap.xml
35+
goto test-v8-exit
36+
37+
:test-v8-exit
38+
popd
39+
if defined savedpath set path=%savedpath%
40+
exit /b %ERROR_STATUS%
41+
42+
:depot-tools-not-found
43+
echo Failed to find a suitable depot tools to test v8
44+
exit /b 1
45+

vcbuild.bat

+15-2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ set build_addons_napi=
4545
set test_node_inspect=
4646
set test_check_deopts=
4747
set js_test_suites=async-hooks inspector known_issues message parallel sequential
48+
set v8_test_options=
49+
set v8_build_options=
4850
set "common_test_suites=%js_test_suites% doctool addons addons-napi&set build_addons=1&set build_addons_napi=1"
4951

5052
:next-arg
@@ -83,6 +85,10 @@ if /i "%1"=="test-async-hooks" set test_args=%test_args% async-hooks&goto arg-o
8385
if /i "%1"=="test-all" set test_args=%test_args% gc internet pummel %common_test_suites%&set build_testgc_addon=1&set cpplint=1&set jslint=1&goto arg-ok
8486
if /i "%1"=="test-node-inspect" set test_node_inspect=1&goto arg-ok
8587
if /i "%1"=="test-check-deopts" set test_check_deopts=1&goto arg-ok
88+
if /i "%1"=="test-v8" set test_v8=1&set custom_v8_test=1&goto arg-ok
89+
if /i "%1"=="test-v8-intl" set test_v8_intl=1&set custom_v8_test=1&goto arg-ok
90+
if /i "%1"=="test-v8-benchmarks" set test_v8_benchmarks=1&set custom_v8_test=1&goto arg-ok
91+
if /i "%1"=="test-v8-all" set test_v8=1&set test_v8_intl=1&set test_v8_benchmarks=1&set custom_v8_test=1&goto arg-ok
8692
if /i "%1"=="jslint" set jslint=1&goto arg-ok
8793
if /i "%1"=="jslint-ci" set jslint_ci=1&goto arg-ok
8894
if /i "%1"=="lint" set cpplint=1&set jslint=1&goto arg-ok
@@ -427,12 +433,18 @@ set USE_EMBEDDED_NODE_INSPECT=1
427433
goto node-tests
428434

429435
:node-tests
430-
if "%test_args%"=="" goto cpplint
436+
if "%test_args%"=="" goto test-v8
431437
if "%config%"=="Debug" set test_args=--mode=debug %test_args%
432438
if "%config%"=="Release" set test_args=--mode=release %test_args%
433439
echo running 'cctest %cctest_args%'
434440
"%config%\cctest" %cctest_args%
435441
call :run-python tools\test.py %test_args%
442+
goto test-v8
443+
444+
:test-v8
445+
if not defined custom_v8_test goto cpplint
446+
call tools/test-v8.bat
447+
if errorlevel 1 goto exit
436448
goto cpplint
437449

438450
:cpplint
@@ -503,7 +515,7 @@ echo Failed to create vc project files.
503515
goto exit
504516

505517
:help
506-
echo vcbuild.bat [debug/release] [msi] [test/test-ci/test-all/test-uv/test-inspector/test-internet/test-pummel/test-simple/test-message/test-async-hooks] [clean] [noprojgen] [small-icu/full-icu/without-intl] [nobuild] [sign] [x86/x64] [vs2015/vs2017] [download-all] [enable-vtune] [lint/lint-ci] [no-NODE-OPTIONS]
518+
echo vcbuild.bat [debug/release] [msi] [test/test-ci/test-all/test-uv/test-inspector/test-internet/test-pummel/test-simple/test-message/test-async-hooks/test-v8/test-v8-intl/test-v8-benchmarks/test-v8-all] [clean] [noprojgen] [small-icu/full-icu/without-intl] [nobuild] [sign] [x86/x64] [vs2015/vs2017] [download-all] [enable-vtune] [lint/lint-ci] [no-NODE-OPTIONS]
507519
echo Examples:
508520
echo vcbuild.bat : builds release build
509521
echo vcbuild.bat debug : builds debug build
@@ -524,6 +536,7 @@ exit /b %ERRORLEVEL%
524536
:exit
525537
goto :EOF
526538

539+
527540
rem ***************
528541
rem Subroutines
529542
rem ***************

0 commit comments

Comments
 (0)