0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 13:09:21 +01:00
nodejs/tools/test-v8.bat
Keyhan Vakil 691f8d1427
build: convert V8 test JSON to JUnit XML
This introduces some code to convert from V8's test JSON output to JUnit
XML. We need this because V8's latest refactor of their test runner has
made it difficult to float our JUnit reporter patch on top (see the
referenced issue).

I also think that there needs to be the same changes to vcbuild.bat, but
I don't know how to do test those yet. I can create a Windows VM and
test it if we decide to go with this approach.

Refs: https://github.com/nodejs/node-v8/issues/236
PR-URL: https://github.com/nodejs/node/pull/44049
Fixes: https://github.com/nodejs/node-v8/issues/236
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2022-10-03 17:45:40 +00:00

49 lines
2.1 KiB
Batchfile

if not defined DEPOT_TOOLS_PATH goto depot-tools-not-found
if "%config%"=="Debug" set test_args=%target_arch%.debug
if "%config%"=="Release" set test_args=%target_arch%.release
set savedpath=%path%
set path=%DEPOT_TOOLS_PATH%;%path%
pushd .
set ERROR_STATUS=0
echo calling: tools\make-v8.sh
sh tools\make-v8.sh
if errorlevel 1 set ERROR_STATUS=1&goto test-v8-exit
cd %~dp0
cd deps\v8
echo running 'python tools\dev\v8gen.py %test_args%'
call python tools\dev\v8gen.py %test_args%
if errorlevel 1 set ERROR_STATUS=1&goto test-v8-exit
echo running 'ninja -C out.gn/%test_args% %v8_build_options%'
call ninja -C out.gn/%test_args% %v8_build_options%
if errorlevel 1 set ERROR_STATUS=1&goto test-v8-exit
set path=%savedpath%
if not defined test_v8 goto test-v8-intl
echo running 'python tools\run-tests.py %common_v8_test_options% %v8_test_options% --slow-tests-cutoff 1000000 --json-test-results v8-tap.xml'
call python tools\run-tests.py %common_v8_test_options% %v8_test_options% --slow-tests-cutoff 1000000 --json-test-results v8-tap.xml
call python ..\..\tools\v8-json-to-junit.py < v8-tap.xml > v8-tap.json
:test-v8-intl
if not defined test_v8_intl goto test-v8-benchmarks
echo running 'python tools\run-tests.py %common_v8_test_options% intl --slow-tests-cutoff 1000000 --json-test-results v8-intl-tap.xml'
call python tools\run-tests.py %common_v8_test_options% intl --slow-tests-cutoff 1000000 --json-test-results ./v8-intl-tap.xml
call python ..\..\tools\v8-json-to-junit.py < v8-intl-tap.xml > v8-intl-tap.json
:test-v8-benchmarks
if not defined test_v8_benchmarks goto test-v8-exit
echo running 'python tools\run-tests.py %common_v8_test_options% benchmarks --slow-tests-cutoff 1000000 --json-test-results v8-benchmarks-tap.xml'
call python tools\run-tests.py %common_v8_test_options% benchmarks --slow-tests-cutoff 1000000 --json-test-results ./v8-benchmarks-tap.xml
call python ..\..\tools\v8-json-to-junit.py < v8-benchmarks-tap.xml > v8-benchmarks-tap.json
goto test-v8-exit
:test-v8-exit
popd
if defined savedpath set path=%savedpath%
exit /b %ERROR_STATUS%
:depot-tools-not-found
echo Failed to find a suitable depot tools to test v8
exit /b 1