From 71cde6635ceaf990d6cc4ea2e77bcaf216e5ec86 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Thu, 9 Nov 2017 23:35:15 +0800 Subject: [PATCH] benchmark: build the misc/function_call addon - Build the addon required by benchmark/misc/function_call - Throw errors in the addon if the binding could not be loaded --- Makefile | 9 ++++++--- benchmark/misc/function_call/index.js | 3 +-- vcbuild.bat | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 7e4b33d571ee79..28f0e3722add1d 100644 --- a/Makefile +++ b/Makefile @@ -247,7 +247,7 @@ test-valgrind: all test-check-deopts: all $(PYTHON) tools/test.py --mode=release --check-deopts parallel sequential -J -benchmark/misc/function_call/build/Release/binding.node: all \ +benchmark/misc/function_call/build/Release/binding.node: \ benchmark/misc/function_call/binding.cc \ benchmark/misc/function_call/binding.gyp $(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \ @@ -314,7 +314,8 @@ test/addons/.buildstamp: config.gypi \ # .buildstamp is out of date and need a rebuild. # Just goes to show that recursive make really is harmful... # TODO(bnoordhuis) Force rebuild after gyp update. -build-addons: | $(NODE_EXE) test/addons/.buildstamp +build-addons: | $(NODE_EXE) test/addons/.buildstamp \ + benchmark/misc/function_call/build/Release/binding.node ADDONS_NAPI_BINDING_GYPS := \ $(filter-out test/addons-napi/??_*/binding.gyp, \ @@ -386,7 +387,8 @@ CI_DOC := doctool # Build and test addons without building anything else test-ci-native: LOGLEVEL := info -test-ci-native: | test/addons/.buildstamp test/addons-napi/.buildstamp +test-ci-native: | test/addons/.buildstamp test/addons-napi/.buildstamp \ + benchmark/misc/function_call/build/Release/binding.node $(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \ --mode=release --flaky-tests=$(FLAKY_TESTS) \ $(TEST_CI_ARGS) $(CI_NATIVE_SUITES) @@ -471,6 +473,7 @@ test-addons: test-build test-addons-napi test-addons-clean: $(RM) -r test/addons/??_*/ $(RM) -r test/addons/*/build + $(RM) -r benchmark/misc/function_call/build $(RM) test/addons/.buildstamp test/addons/.docbuildstamp $(MAKE) test-addons-napi-clean diff --git a/benchmark/misc/function_call/index.js b/benchmark/misc/function_call/index.js index 6a2595d2ae188d..3f7dba609f2ddd 100644 --- a/benchmark/misc/function_call/index.js +++ b/benchmark/misc/function_call/index.js @@ -14,8 +14,7 @@ const common = require('../../common.js'); try { var binding = require('./build/Release/binding'); } catch (er) { - console.error('misc/function_call.js Binding failed to load'); - process.exit(0); + throw new Error('misc/function_call.js Binding failed to load'); } const cxx = binding.hello; diff --git a/vcbuild.bat b/vcbuild.bat index a765bcb439b3c5..0eff3fd191615a 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -410,7 +410,7 @@ for /d %%F in (test\addons\??_*) do ( if %errorlevel% neq 0 exit /b %errorlevel% :: building addons setlocal EnableDelayedExpansion -for /d %%F in (test\addons\*) do ( +for /d %%F in (test\addons\* benchmark\misc\function_call) do ( %node_gyp_exe% rebuild ^ --directory="%%F" ^ --nodedir="%cd%"