From f99ca878b7b9fa4fa28ccba61cbee454262d0db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Reis?= Date: Fri, 29 Nov 2019 00:51:30 +0000 Subject: [PATCH 1/2] build,win: add test-ci-native and test-ci-js --- Makefile | 1 + vcbuild.bat | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 92d98f0351c4ce..316410e3f81e39 100644 --- a/Makefile +++ b/Makefile @@ -425,6 +425,7 @@ test-all: test-build ## Run everything in test/. test-all-valgrind: test-build $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=debug,release --valgrind +# CI_* variables should be kept synchronized with the ones in vcbuild.bat CI_NATIVE_SUITES ?= addons addons-napi CI_JS_SUITES ?= default CI_DOC := doctool diff --git a/vcbuild.bat b/vcbuild.bat index 65d555a5508c31..26c6b26dee69c0 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -15,6 +15,13 @@ if /i "%1"=="/?" goto help cd %~dp0 +@rem CI_* variables should be kept synchronized with the ones in Makefile +set CI_NATIVE_SUITES=addons addons-napi +set CI_JS_SUITES=default +set CI_DOC=doctool +@rem Same as the test-ci target in Makefile +set "common_test_suites=%CI_JS_SUITES% %CI_NATIVE_SUITES% %CI_DOC%&set build_addons=1&set build_addons_napi=1" + @rem Process arguments. set config=Release set target=Build @@ -52,10 +59,8 @@ set enable_static= set build_addons_napi= set test_node_inspect= set test_check_deopts= -set js_test_suites=default set v8_test_options= set v8_build_options= -set "common_test_suites=%js_test_suites% doctool addons addons-napi&set build_addons=1&set build_addons_napi=1" set http2_debug= set nghttp2_debug= set link_module= @@ -88,6 +93,8 @@ if /i "%1"=="nopch" set "pch="&goto arg-ok if /i "%1"=="licensertf" set licensertf=1&goto arg-ok if /i "%1"=="test" set test_args=%test_args% -J %common_test_suites%&set lint_cpp=1&set lint_js=1&set lint_md=1&goto arg-ok if /i "%1"=="test-ci" set test_args=%test_args% %test_ci_args% -p tap --logfile test.tap %common_test_suites%&set cctest_args=%cctest_args% --gtest_output=tap:cctest.tap&goto arg-ok +if /i "%1"=="test-ci-native" set test_args=%test_args% %test_ci_args% -J -p tap --logfile test.tap %CI_NATIVE_SUITES% %CI_DOC%&set build_addons=1&set build_addons_napi=1&set cctest_args=%cctest_args% --gtest_output=tap:cctest.tap&goto arg-ok +if /i "%1"=="test-ci-js" set test_args=%test_args% %test_ci_args% -J -p tap --logfile test.tap %CI_JS_SUITES%&set no_cctest=1&goto arg-ok if /i "%1"=="build-addons" set build_addons=1&goto arg-ok if /i "%1"=="build-addons-napi" set build_addons_napi=1&goto arg-ok if /i "%1"=="test-addons" set test_args=%test_args% addons&set build_addons=1&goto arg-ok From 40974316ff3c6d69ef72d00165b2092d2fec865e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Reis?= Date: Sat, 30 Nov 2019 01:13:48 +0000 Subject: [PATCH 2/2] build,win: propagate error codes in vcbuild Don't exit vcbuild with error code 0 when cctest fails. --- vcbuild.bat | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vcbuild.bat b/vcbuild.bat index 26c6b26dee69c0..c7c156e9b41d2d 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -68,7 +68,8 @@ set no_cctest= set cctest= set openssl_no_asm= set doc= -set extra_msbuild_args=^ +set extra_msbuild_args= +set exit_code=0 :next-arg if "%1"=="" goto args-done @@ -559,9 +560,11 @@ if defined no_cctest echo Skipping cctest because no-cctest was specified && got if not exist "%config%\cctest.exe" echo cctest.exe not found. Run "vcbuild test" or "vcbuild cctest" to build it. && goto run-test-py echo running 'cctest %cctest_args%' "%config%\cctest" %cctest_args% +if %errorlevel% neq 0 set exit_code=%errorlevel% :run-test-py echo running 'python tools\test.py %test_args%' python tools\test.py %test_args% +if %errorlevel% neq 0 set exit_code=%errorlevel% goto test-v8 :test-v8 @@ -672,7 +675,7 @@ echo vcbuild.bat no-cctest : skip building cctest.exe goto exit :exit -goto :EOF +exit /b %exit_code% rem ***************