Skip to content

Commit

Permalink
benchmark: build the misc/function_call addon
Browse files Browse the repository at this point in the history
- Build the addon required by benchmark/misc/function_call
- Throw errors in the addon if the binding could not be loaded
  • Loading branch information
joyeecheung committed Nov 19, 2017
1 parent 5f720be commit 71cde66
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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, \
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions benchmark/misc/function_call/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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%"
Expand Down

0 comments on commit 71cde66

Please sign in to comment.