292292 tools/make-v8.sh $(V8_ARCH ) .$(BUILDTYPE_LOWER ) $(V8_BUILD_OPTIONS )
293293
294294.PHONY : jstest
295- jstest : build-addons build-js-native-api-tests build-node-api-tests # # Runs addon tests and JS tests
295+ jstest : build-addons build-abort-tests build- js-native-api-tests build-node-api-tests # # Runs addon tests and JS tests
296296 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) \
297297 --skip-tests=$(CI_SKIP_TESTS ) \
298298 $(CI_JS_SUITES ) \
@@ -316,6 +316,7 @@ test: all ## Runs default tests, linters, and builds docs.
316316 $(MAKE ) -s tooltest
317317 $(MAKE ) -s test-doc
318318 $(MAKE ) -s build-addons
319+ $(MAKE ) -s build-abort-tests
319320 $(MAKE ) -s build-js-native-api-tests
320321 $(MAKE ) -s build-node-api-tests
321322 $(MAKE ) -s cctest
@@ -324,6 +325,7 @@ test: all ## Runs default tests, linters, and builds docs.
324325.PHONY : test-only
325326test-only : all # # For a quick test, does not run linter or build docs.
326327 $(MAKE ) build-addons
328+ $(MAKE ) build-abort-tests
327329 $(MAKE ) build-js-native-api-tests
328330 $(MAKE ) build-node-api-tests
329331 $(MAKE ) cctest
@@ -333,6 +335,7 @@ test-only: all ## For a quick test, does not run linter or build docs.
333335# Used by `make coverage-test`
334336test-cov : all
335337 $(MAKE ) build-addons
338+ $(MAKE ) build-abort-tests
336339 $(MAKE ) build-js-native-api-tests
337340 $(MAKE ) build-node-api-tests
338341 $(MAKE ) cctest
@@ -452,6 +455,31 @@ test/node-api/.buildstamp: $(ADDONS_PREREQS) \
452455# TODO(bnoordhuis) Force rebuild after gyp or node-gyp update.
453456build-node-api-tests : | $(NODE_EXE ) test/node-api/.buildstamp
454457
458+ ABORT_BINDING_GYPS := \
459+ $(filter-out test/abort/??_* /binding.gyp, \
460+ $(wildcard test/abort/* /binding.gyp) )
461+
462+ ABORT_BINDING_SOURCES := \
463+ $(filter-out test/abort/??_* /* .c, $(wildcard test/abort/* /* .c) ) \
464+ $(filter-out test/abort/??_* /* .cc, $(wildcard test/abort/* /* .cc) ) \
465+ $(filter-out test/abort/??_* /* .h, $(wildcard test/abort/* /* .h) )
466+
467+ # Implicitly depends on $(NODE_EXE), see the build-node-api-tests rule for rationale.
468+ test/abort/.buildstamp : $(ADDONS_PREREQS ) \
469+ $(ABORT_BINDING_GYPS ) $(ABORT_BINDING_SOURCES ) \
470+ src/node_api.h src/node_api_types.h src/js_native_api.h \
471+ src/js_native_api_types.h src/js_native_api_v8.h src/js_native_api_v8_internals.h
472+ @$(call run_build_addons,"$$PWD/test/abort",$@ )
473+
474+ .PHONY : build-abort-tests
475+ # .buildstamp needs $(NODE_EXE) but cannot depend on it
476+ # directly because it calls make recursively. The parent make cannot know
477+ # if the subprocess touched anything so it pessimistically assumes that
478+ # .buildstamp is out of date and need a rebuild.
479+ # Just goes to show that recursive make really is harmful...
480+ # TODO(bnoordhuis) Force rebuild after gyp or node-gyp update.
481+ build-abort-tests : | $(NODE_EXE ) test/abort/.buildstamp
482+
455483BENCHMARK_NAPI_BINDING_GYPS := $(wildcard benchmark/napi/* /binding.gyp)
456484
457485BENCHMARK_NAPI_BINDING_SOURCES := \
@@ -472,12 +500,14 @@ clear-stalled:
472500 echo $$ {PS_OUT} | xargs kill -9; \
473501 fi
474502
475- test-build : | all build-addons build-js-native-api-tests build-node-api-tests
503+ test-build : | all build-addons build-abort-tests build- js-native-api-tests build-node-api-tests
476504
477505test-build-js-native-api : all build-js-native-api-tests
478506
479507test-build-node-api : all build-node-api-tests
480508
509+ test-build-abort : all build-abort-tests
510+
481511.PHONY : test-all
482512test-all : test-build # # Run default tests with both Debug and Release builds.
483513 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=debug,release
@@ -490,7 +520,7 @@ test-all-suites: | clear-stalled test-build bench-addons-build doc-only ## Run a
490520 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) test/*
491521
492522# CI_* variables should be kept synchronized with the ones in vcbuild.bat
493- CI_NATIVE_SUITES ?= addons js-native-api node-api
523+ CI_NATIVE_SUITES ?= addons js-native-api node-api abort
494524CI_JS_SUITES ?= default
495525ifeq ($(node_use_openssl ) , false)
496526 CI_DOC := doctool
@@ -502,7 +532,7 @@ endif
502532# Build and test addons without building anything else
503533# Related CI job: node-test-commit-arm-fanned
504534test-ci-native : LOGLEVEL := info
505- test-ci-native : | test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp
535+ test-ci-native : | test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp test/abort/.buildstamp
506536 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) -p tap --logfile test.tap \
507537 --mode=$(BUILDTYPE_LOWER ) --flaky-tests=$(FLAKY_TESTS ) \
508538 $(TEST_CI_ARGS ) $(CI_NATIVE_SUITES )
@@ -524,7 +554,7 @@ test-ci-js: | clear-stalled
524554.PHONY : test-ci
525555# Related CI jobs: most CI tests, excluding node-test-commit-arm-fanned
526556test-ci : LOGLEVEL := info
527- test-ci : | clear-stalled build-addons build-js-native-api-tests build-node-api-tests doc-only
557+ test-ci : | clear-stalled build-addons build-abort-tests build- js-native-api-tests build-node-api-tests doc-only
528558 out/Release/cctest --gtest_output=xml:out/junit/cctest.xml
529559 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) -p tap --logfile test.tap \
530560 --mode=$(BUILDTYPE_LOWER ) --flaky-tests=$(FLAKY_TESTS ) \
@@ -628,8 +658,17 @@ test-node-api-clean:
628658 $(RM ) -r test/node-api/* /build
629659 $(RM ) test/node-api/.buildstamp
630660
661+ .PHONY : test-abort
662+ test-abort : test-build-abort
663+ $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) test-abort
664+
665+ .PHONY : test-abort-clean
666+ test-abort-clean :
667+ $(RM ) -r test/abort/* /build
668+ $(RM ) test/abort/.buildstamp
669+
631670.PHONY : test-addons
632- test-addons : test-build test-js-native-api test-node-api
671+ test-addons : test-build test-js-native-api test-node-api test-abort
633672 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) addons
634673
635674.PHONY : test-addons-clean
@@ -639,6 +678,7 @@ test-addons-clean:
639678 $(RM ) test/addons/.buildstamp test/addons/.docbuildstamp
640679 $(MAKE ) test-js-native-api-clean
641680 $(MAKE ) test-node-api-clean
681+ $(MAKE ) test-abort-clean
642682
643683test-async-hooks :
644684 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) async-hooks
@@ -647,6 +687,7 @@ test-with-async-hooks:
647687 $(MAKE ) build-addons
648688 $(MAKE ) build-js-native-api-tests
649689 $(MAKE ) build-node-api-tests
690+ $(MAKE ) build-abort-tests
650691 $(MAKE ) cctest
651692 NODE_TEST_WITH_ASYNC_HOOKS=1 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) \
652693 $(CI_JS_SUITES ) \
0 commit comments