295295 tools/make-v8.sh $(V8_ARCH ) .$(BUILDTYPE_LOWER ) $(V8_BUILD_OPTIONS )
296296
297297.PHONY : jstest
298- jstest : build-addons build-js-native-api-tests build-node-api-tests # # Runs addon tests and JS tests
298+ jstest : build-addons build-abort-tests build- js-native-api-tests build-node-api-tests # # Runs addon tests and JS tests
299299 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) \
300300 --skip-tests=$(CI_SKIP_TESTS ) \
301301 $(CI_JS_SUITES ) \
@@ -319,6 +319,7 @@ test: all ## Runs default tests, linters, and builds docs.
319319 $(MAKE ) -s tooltest
320320 $(MAKE ) -s test-doc
321321 $(MAKE ) -s build-addons
322+ $(MAKE ) -s build-abort-tests
322323 $(MAKE ) -s build-js-native-api-tests
323324 $(MAKE ) -s build-node-api-tests
324325 $(MAKE ) -s cctest
@@ -327,6 +328,7 @@ test: all ## Runs default tests, linters, and builds docs.
327328.PHONY : test-only
328329test-only : all # # For a quick test, does not run linter or build docs.
329330 $(MAKE ) build-addons
331+ $(MAKE ) build-abort-tests
330332 $(MAKE ) build-js-native-api-tests
331333 $(MAKE ) build-node-api-tests
332334 $(MAKE ) cctest
@@ -336,6 +338,7 @@ test-only: all ## For a quick test, does not run linter or build docs.
336338# Used by `make coverage-test`
337339test-cov : all
338340 $(MAKE ) build-addons
341+ $(MAKE ) build-abort-tests
339342 $(MAKE ) build-js-native-api-tests
340343 $(MAKE ) build-node-api-tests
341344 $(MAKE ) cctest
@@ -455,6 +458,31 @@ test/node-api/.buildstamp: $(ADDONS_PREREQS) \
455458# TODO(bnoordhuis) Force rebuild after gyp or node-gyp update.
456459build-node-api-tests : | $(NODE_EXE ) test/node-api/.buildstamp
457460
461+ ABORT_BINDING_GYPS := \
462+ $(filter-out test/abort/??_* /binding.gyp, \
463+ $(wildcard test/abort/* /binding.gyp) )
464+
465+ ABORT_BINDING_SOURCES := \
466+ $(filter-out test/abort/??_* /* .c, $(wildcard test/abort/* /* .c) ) \
467+ $(filter-out test/abort/??_* /* .cc, $(wildcard test/abort/* /* .cc) ) \
468+ $(filter-out test/abort/??_* /* .h, $(wildcard test/abort/* /* .h) )
469+
470+ # Implicitly depends on $(NODE_EXE), see the build-node-api-tests rule for rationale.
471+ test/abort/.buildstamp : $(ADDONS_PREREQS ) \
472+ $(ABORT_BINDING_GYPS ) $(ABORT_BINDING_SOURCES ) \
473+ src/node_api.h src/node_api_types.h src/js_native_api.h \
474+ src/js_native_api_types.h src/js_native_api_v8.h src/js_native_api_v8_internals.h
475+ @$(call run_build_addons,"$$PWD/test/abort",$@ )
476+
477+ .PHONY : build-abort-tests
478+ # .buildstamp needs $(NODE_EXE) but cannot depend on it
479+ # directly because it calls make recursively. The parent make cannot know
480+ # if the subprocess touched anything so it pessimistically assumes that
481+ # .buildstamp is out of date and need a rebuild.
482+ # Just goes to show that recursive make really is harmful...
483+ # TODO(bnoordhuis) Force rebuild after gyp or node-gyp update.
484+ build-abort-tests : | $(NODE_EXE ) test/abort/.buildstamp
485+
458486BENCHMARK_NAPI_BINDING_GYPS := $(wildcard benchmark/napi/* /binding.gyp)
459487
460488BENCHMARK_NAPI_BINDING_SOURCES := \
@@ -475,12 +503,14 @@ clear-stalled:
475503 echo $$ {PS_OUT} | xargs kill -9; \
476504 fi
477505
478- test-build : | all build-addons build-js-native-api-tests build-node-api-tests
506+ test-build : | all build-addons build-abort-tests build- js-native-api-tests build-node-api-tests
479507
480508test-build-js-native-api : all build-js-native-api-tests
481509
482510test-build-node-api : all build-node-api-tests
483511
512+ test-build-abort : all build-abort-tests
513+
484514.PHONY : test-all
485515test-all : test-build # # Run default tests with both Debug and Release builds.
486516 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=debug,release
@@ -493,7 +523,7 @@ test-all-suites: | clear-stalled test-build bench-addons-build doc-only ## Run a
493523 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) test/*
494524
495525# CI_* variables should be kept synchronized with the ones in vcbuild.bat
496- CI_NATIVE_SUITES ?= addons js-native-api node-api
526+ CI_NATIVE_SUITES ?= addons js-native-api node-api abort
497527CI_JS_SUITES ?= default
498528ifeq ($(node_use_openssl ) , false)
499529 CI_DOC := doctool
@@ -505,7 +535,7 @@ endif
505535# Build and test addons without building anything else
506536# Related CI job: node-test-commit-arm-fanned
507537test-ci-native : LOGLEVEL := info
508- test-ci-native : | test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp
538+ test-ci-native : | test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp test/abort/.buildstamp
509539 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) -p tap --logfile test.tap \
510540 --mode=$(BUILDTYPE_LOWER ) --flaky-tests=$(FLAKY_TESTS ) \
511541 $(TEST_CI_ARGS ) $(CI_NATIVE_SUITES )
@@ -527,7 +557,7 @@ test-ci-js: | clear-stalled
527557.PHONY : test-ci
528558# Related CI jobs: most CI tests, excluding node-test-commit-arm-fanned
529559test-ci : LOGLEVEL := info
530- test-ci : | clear-stalled build-addons build-js-native-api-tests build-node-api-tests doc-only
560+ test-ci : | clear-stalled build-addons build-abort-tests build- js-native-api-tests build-node-api-tests doc-only
531561 out/Release/cctest --gtest_output=xml:out/junit/cctest.xml
532562 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) -p tap --logfile test.tap \
533563 --mode=$(BUILDTYPE_LOWER ) --flaky-tests=$(FLAKY_TESTS ) \
@@ -632,8 +662,17 @@ test-node-api-clean:
632662 $(RM ) -r test/node-api/* /build
633663 $(RM ) test/node-api/.buildstamp
634664
665+ .PHONY : test-abort
666+ test-abort : test-build-abort
667+ $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) test-abort
668+
669+ .PHONY : test-abort-clean
670+ test-abort-clean :
671+ $(RM ) -r test/abort/* /build
672+ $(RM ) test/abort/.buildstamp
673+
635674.PHONY : test-addons
636- test-addons : test-build test-js-native-api test-node-api
675+ test-addons : test-build test-js-native-api test-node-api test-abort
637676 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) addons
638677
639678.PHONY : test-addons-clean
@@ -643,6 +682,7 @@ test-addons-clean:
643682 $(RM ) test/addons/.buildstamp test/addons/.docbuildstamp
644683 $(MAKE ) test-js-native-api-clean
645684 $(MAKE ) test-node-api-clean
685+ $(MAKE ) test-abort-clean
646686
647687test-async-hooks :
648688 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) async-hooks
@@ -651,6 +691,7 @@ test-with-async-hooks:
651691 $(MAKE ) build-addons
652692 $(MAKE ) build-js-native-api-tests
653693 $(MAKE ) build-node-api-tests
694+ $(MAKE ) build-abort-tests
654695 $(MAKE ) cctest
655696 NODE_TEST_WITH_ASYNC_HOOKS=1 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) \
656697 $(CI_JS_SUITES ) \
0 commit comments