Skip to content

Commit 77bed26

Browse files
Bogdan Loborevanlucas
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 afcd276 commit 77bed26

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
@@ -36,6 +36,7 @@ set release_urls_arg=
3636
setbuild_release=
3737
setenable_vtune_arg=
3838
setconfigure_flags=
39+
setbuild_addons=
3940

4041
:next-arg
4142
if"%1"==""goto args-done
@@ -54,8 +55,9 @@ if /i "%1"=="nosnapshot" set nosnapshot=1&goto arg-ok
5455
if /i "%1"=="noetw"setnoetw=1&goto arg-ok
5556
if /i "%1"=="noperfctr"setnoperfctr=1&goto arg-ok
5657
if /i "%1"=="licensertf"setlicensertf=1&goto arg-ok
57-
if /i "%1"=="test"settest_args=%test_args% sequential parallel message -J&set jslint=1&goto arg-ok
58-
if /i "%1"=="test-ci"settest_args=%test_args%%test_ci_args% -p tap --logfile test.tap message sequential parallel&goto arg-ok
58+
if /i "%1"=="test"settest_args=%test_args% addons sequential parallel message -J&set jslint=1&set build_addons=1&goto arg-ok
59+
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
60+
if /i "%1"=="test-addons"settest_args=%test_args% addons&set build_addons=1&goto arg-ok
5961
if /i "%1"=="test-simple"settest_args=%test_args% sequential parallel -J&goto arg-ok
6062
if /i "%1"=="test-message"settest_args=%test_args% message&goto arg-ok
6163
if /i "%1"=="test-gc"settest_args=%test_args% gc&set buildnodeweak=1&goto arg-ok
@@ -91,6 +93,9 @@ if defined build_release (
9193
seti18n_arg=small-icu
9294
)
9395

96+
:: assign path to node_exe
97+
set"node_exe=%config%\node.exe"
98+
9499
if"%config%"=="Debug"setconfigure_flags=%configure_flags% --debug
95100
ifdefined nosnapshot setconfigure_flags=%configure_flags% --without-snapshot
96101
ifdefined noetw setconfigure_flags=%configure_flags% --without-etw&setnoetw_msi_arg=/p:NoETW=1
@@ -240,15 +245,36 @@ ssh -F %SSHCONFIG% %STAGINGSERVER% "touch nodejs/%DISTTYPEDIR%/v%FULLVERSION%/no
240245

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

248253
:build-node-weak-failed
249254
echo Failed to build node-weak.
250255
gotoexit
251256

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

0 commit comments

Comments
 (0)