Skip to content

Commit f7eb483

Browse files
Bogdan LoborMyles Borins
authored andcommitted
win,build: build and test add-ons on test-ci
Added build-addons task, it allows to build and test native addons during test-ci task. Basically it should work in same way like Makefile "build-addons" task. Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: João Reis <reis@janeasystems.com> PR-URL: #5886Fixes: #2537
1 parent 86d2af5 commit f7eb483

1 file changed

Lines changed: 30 additions & 4 deletions

File tree

‎vcbuild.bat‎

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ set download_arg=
3535
setrelease_urls_arg=
3636
setbuild_release=
3737
setconfigure_flags=
38+
setbuild_addons=
3839

3940
:next-arg
4041
if"%1"==""goto args-done
@@ -53,8 +54,9 @@ if /i "%1"=="nosnapshot" set nosnapshot=1&goto arg-ok
5354
if /i "%1"=="noetw"setnoetw=1&goto arg-ok
5455
if /i "%1"=="noperfctr"setnoperfctr=1&goto arg-ok
5556
if /i "%1"=="licensertf"setlicensertf=1&goto arg-ok
56-
if /i "%1"=="test"settest_args=%test_args% sequential parallel message -J&set jslint=1&goto arg-ok
57-
if /i "%1"=="test-ci"settest_args=%test_args%%test_ci_args% -p tap --logfile test.tap message sequential parallel&goto arg-ok
57+
if /i "%1"=="test"settest_args=%test_args% addons sequential parallel message -J&set jslint=1&set build_addons=1&goto arg-ok
58+
if /i "%1"=="test-ci"settest_args=%test_args%%test_ci_args% -p tap --logfile test.tap addons message sequential parallel&set build_addons=1&goto arg-ok
59+
if /i "%1"=="test-addons"settest_args=%test_args% addons&set build_addons=1&goto arg-ok
5860
if /i "%1"=="test-simple"settest_args=%test_args% sequential parallel -J&goto arg-ok
5961
if /i "%1"=="test-message"settest_args=%test_args% message&goto arg-ok
6062
if /i "%1"=="test-gc"settest_args=%test_args% gc&set buildnodeweak=1&goto arg-ok
@@ -89,6 +91,9 @@ if defined build_release (
8991
seti18n_arg=small-icu
9092
)
9193

94+
:: assign path to node_exe
95+
set"node_exe=%config%\node.exe"
96+
9297
if"%config%"=="Debug"setconfigure_flags=%configure_flags% --debug
9398
ifdefined nosnapshot setconfigure_flags=%configure_flags% --without-snapshot
9499
ifdefined noetw setconfigure_flags=%configure_flags% --without-etw&setnoetw_msi_arg=/p:NoETW=1
@@ -237,15 +242,36 @@ ssh -F %SSHCONFIG% %STAGINGSERVER% "touch nodejs/%DISTTYPEDIR%/v%FULLVERSION%/no
237242

238243
:build-node-weak
239244
@rem Build node-weak if required
240-
if"%buildnodeweak%"==""gotorun-tests
245+
if"%buildnodeweak%"==""gotobuild-addons
241246
"%config%\node" deps\npm\node_modules\node-gyp\bin\node-gyp rebuild --directory="%~dp0test\gc\node_modules\weak" --nodedir="%~dp0."
242247
iferrorlevel1goto build-node-weak-failed
243-
gotorun-tests
248+
gotobuild-addons
244249

245250
:build-node-weak-failed
246251
echo Failed to build node-weak.
247252
gotoexit
248253

254+
:build-addons
255+
ifnotdefined build_addons goto run-tests
256+
ifnotexist"%node_exe%" (
257+
echo Failed to find node.exe
258+
goto run-tests
259+
)
260+
echo Building add-ons
261+
:: clear
262+
for /d %%Fin (test\addons\??_*) do (
263+
rd /s /q %%F
264+
)
265+
:: generate
266+
"%node_exe%" tools\doc\addon-verify.js
267+
:: building addons
268+
for /d %%Fin (test\addons\*) do (
269+
"%node_exe%" deps\npm\node_modules\node-gyp\bin\node-gyp rebuild ^
270+
--directory="%%F"^
271+
--nodedir="%cd%"
272+
)
273+
goto run-tests
274+
249275
:run-tests
250276
if"%test_args%"==""goto jslint
251277
if"%config%"=="Debug"settest_args=--mode=debug %test_args%

0 commit comments

Comments
 (0)