Skip to content

Commit 25da074

Browse files
piscisaureusrvagg
authored andcommitted
build: improve vcbuild.bat
* Support running multiple test suites (e.g. vcbuild test-simple test-gc). * Removed a nonexisting test suite (test-uv). * Removed superfluous extra layer of argument parsing. * Fix the node-weak build. R=@rvagg PR-URL: #998 Reviewed-By: Rod Vagg <[email protected]>
1 parent b8310cb commit 25da074

File tree

1 file changed

+18
-31
lines changed

1 file changed

+18
-31
lines changed

vcbuild.bat

+18-31
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ set noprojgen=
2222
set nobuild=
2323
set nosign=
2424
set snapshot=
25-
set test=
2625
set test_args=
2726
set msi=
2827
set licensertf=
@@ -52,16 +51,15 @@ if /i "%1"=="snapshot" set snapshot=1&goto arg-ok
5251
if /i "%1"=="noetw" set noetw=1&goto arg-ok
5352
if /i "%1"=="noperfctr" set noperfctr=1&goto arg-ok
5453
if /i "%1"=="licensertf" set licensertf=1&goto arg-ok
55-
if /i "%1"=="test-uv" set test=test-uv&goto arg-ok
56-
if /i "%1"=="test-internet" set test=test-internet&goto arg-ok
57-
if /i "%1"=="test-pummel" set test=test-pummel&goto arg-ok
58-
if /i "%1"=="test-simple" set test=test-simple&goto arg-ok
59-
if /i "%1"=="test-message" set test=test-message&goto arg-ok
60-
if /i "%1"=="test-gc" set test=test-gc&set buildnodeweak=1&goto arg-ok
61-
if /i "%1"=="test-all" set test=test-all&set buildnodeweak=1&goto arg-ok
62-
if /i "%1"=="test" set test=test&goto arg-ok
63-
if /i "%1"=="msi" set msi=1&set licensertf=1&goto arg-ok
54+
if /i "%1"=="test" set test_args=%test_args% sequential parallel message -J&set jslint=1&goto arg-ok
55+
if /i "%1"=="test-simple" set test_args=%test_args% sequential parallel -J&goto arg-ok
56+
if /i "%1"=="test-message" set test_args=%test_args% message&goto arg-ok
57+
if /i "%1"=="test-gc" set test_args=%test_args% gc&set buildnodeweak=1&goto arg-ok
58+
if /i "%1"=="test-internet" set test_args=%test_args% internet&goto arg-ok
59+
if /i "%1"=="test-pummel" set test_args=%test_args% pummel&goto arg-ok
60+
if /i "%1"=="test-all" set test_args=%test_args% sequential parallel message gc internet pummel&buildnodeweak1=1&set jslint=1&goto arg-ok
6461
if /i "%1"=="jslint" set jslint=1&goto arg-ok
62+
if /i "%1"=="msi" set msi=1&set licensertf=1&goto arg-ok
6563
if /i "%1"=="small-icu" set i18n_arg=%1&goto arg-ok
6664
if /i "%1"=="full-icu" set i18n_arg=%1&goto arg-ok
6765
if /i "%1"=="intl-none" set i18n_arg=%1&goto arg-ok
@@ -75,8 +73,6 @@ shift
7573
goto next-arg
7674

7775
:args-done
78-
if defined jslint goto jslint
79-
8076
if "%config%"=="Debug" set debug_arg=--debug
8177
if "%target_arch%"=="x64" set msiplatform=x64
8278
if defined snapshot set snapshot_arg=--with-snapshot
@@ -159,23 +155,11 @@ if errorlevel 1 echo Failed to sign msi&goto exit
159155

160156
:run
161157
@rem Run tests if requested.
162-
if "%test%"=="" goto exit
163-
164-
if "%config%"=="Debug" set test_args=--mode=debug
165-
if "%config%"=="Release" set test_args=--mode=release
166-
167-
if "%test%"=="test" set test_args=%test_args% sequential parallel message -J
168-
if "%test%"=="test-internet" set test_args=%test_args% internet
169-
if "%test%"=="test-pummel" set test_args=%test_args% pummel
170-
if "%test%"=="test-simple" set test_args=%test_args% sequential parallel
171-
if "%test%"=="test-message" set test_args=%test_args% message
172-
if "%test%"=="test-gc" set test_args=%test_args% gc
173-
if "%test%"=="test-all" set test_args=%test_args%
174158

175159
:build-node-weak
176160
@rem Build node-weak if required
177161
if "%buildnodeweak%"=="" goto run-tests
178-
"%config%\node" deps\npm\node_modules\node-gyp\bin\node-gyp rebuild --directory="%~dp0test\gc\node_modules\weak" --nodedir="%~dp0."
162+
"%config%\iojs" deps\npm\node_modules\node-gyp\bin\node-gyp rebuild --directory="%~dp0test\gc\node_modules\weak" --nodedir="%~dp0."
179163
if errorlevel 1 goto build-node-weak-failed
180164
goto run-tests
181165

@@ -184,21 +168,24 @@ echo Failed to build node-weak.
184168
goto exit
185169

186170
:run-tests
171+
if "%test_args%"=="" goto jslint
172+
if "%config%"=="Debug" set test_args=--mode=debug %test_args%
173+
if "%config%"=="Release" set test_args=--mode=release %test_args%
187174
echo running 'python tools/test.py %test_args%'
188175
python tools/test.py %test_args%
189-
if "%test%"=="test" goto jslint
190-
goto exit
191-
192-
:create-msvs-files-failed
193-
echo Failed to create vc project files.
194-
goto exit
176+
goto jslint
195177

196178
:jslint
179+
if not defined jslint goto exit
197180
echo running jslint
198181
set PYTHONPATH=tools/closure_linter/;tools/gflags/
199182
python tools/closure_linter/closure_linter/gjslint.py --unix_mode --strict --nojsdoc -r lib/ -r src/ --exclude_files lib/punycode.js
200183
goto exit
201184

185+
:create-msvs-files-failed
186+
echo Failed to create vc project files.
187+
goto exit
188+
202189
:help
203190
echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/intl-none] [nobuild] [nosign] [x86/x64] [download-all]
204191
echo Examples:

0 commit comments

Comments
 (0)