@@ -551,17 +551,25 @@ FFI_BINDING_SOURCES := \
551551 $(wildcard test/ffi/* /* .c) \
552552 $(wildcard test/ffi/* /* .def)
553553
554+ ifndef NOFFI
554555# Implicitly depends on $(NODE_EXE), see the build-ffi-tests rule for rationale.
555556test/ffi/.buildstamp : $(ADDONS_PREREQS ) \
556557 $(FFI_BINDING_GYPS ) $(FFI_BINDING_SOURCES )
557558 @$(call run_build_addons,"$$PWD/test/ffi",$@ )
559+ else
560+ test/ffi/.buildstamp :
561+ endif
558562
559563.PHONY : build-ffi-tests
564+ ifndef NOFFI
560565# .buildstamp needs $(NODE_EXE) but cannot depend on it
561566# directly because it calls make recursively. The parent make cannot know
562567# if the subprocess touched anything so it pessimistically assumes that
563568# .buildstamp is out of date and need a rebuild.
564569build-ffi-tests : | $(NODE_EXE ) test/ffi/.buildstamp # # Build FFI tests.
570+ else
571+ build-ffi-tests :
572+ endif
565573
566574.PHONY : clear-stalled
567575clear-stalled : # # Clear any stalled processes.
@@ -584,6 +592,8 @@ test-build-node-api: all build-node-api-tests ## Build Node-API tests.
584592.PHONY : test-build-sqlite
585593test-build-sqlite : all build-sqlite-tests # # Build SQLite tests.
586594
595+ .PHONY : test-build-ffi
596+ test-build-ffi : all build-ffi-tests # # Build FFI tests.
587597
588598.PHONY : test-all
589599test-all : test-build # # Run default tests with both Debug and Release builds.
@@ -653,6 +663,7 @@ test-ci: | clear-stalled bench-addons-build build-addons build-js-native-api-tes
653663build-ci : # # Build everything (CI).
654664 $(PYTHON ) ./configure --verbose $(CONFIG_FLAGS )
655665 $(MAKE )
666+ $(MAKE ) build-ffi-tests
656667
657668.PHONY : run-ci
658669# Run by CI tests, exceptions:
@@ -755,6 +766,16 @@ test-sqlite-clean: ## Remove SQLite testing artifacts.
755766 $(RM ) -r test/sqlite/* /build
756767 $(RM ) test/sqlite/.buildstamp
757768
769+ .PHONY : test-ffi
770+ test-ffi : test-build-ffi # # Run FFI tests.
771+ $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) ffi
772+
773+ .PHONY : test-ffi-clean
774+ .NOTPARALLEL : test-ffi-clean
775+ test-ffi-clean : # # Remove FFI testing artifacts.
776+ $(RM ) -r test/ffi/* /build
777+ $(RM ) test/ffi/.buildstamp
778+
758779.PHONY : test-addons
759780test-addons : test-build test-js-native-api test-node-api # # Run addon tests.
760781 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) addons
@@ -1249,6 +1270,7 @@ ifeq ($(SKIP_SHARED_DEPS), 1)
12491270 $(RM) -r $(TARNAME)/deps/icu-small
12501271 $(RM) -r $(TARNAME)/deps/icu-tmp
12511272 $(RM) -r $(TARNAME)/deps/LIEF
1273+ $(RM) -r $(TARNAME)/deps/libffi
12521274 $(RM) -r $(TARNAME)/deps/llhttp
12531275 $(RM) -r $(TARNAME)/deps/merve
12541276 $(RM) -r $(TARNAME)/deps/nbytes
@@ -1523,6 +1545,7 @@ LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \
15231545 test/embedding/* .cc \
15241546 test/embedding/* .h \
15251547 test/sqlite/* /* .c \
1548+ test/ffi/* /* .c \
15261549 test/fixtures/* .c \
15271550 test/js-native-api/* /* .cc \
15281551 test/node-api/* /* .cc \
@@ -1547,6 +1570,7 @@ FORMAT_CPP_FILES += $(wildcard \
15471570 test/node-api/* /* .c \
15481571 test/node-api/* /* .h \
15491572 test/sqlite/* /* .c \
1573+ test/ffi/* /* .c \
15501574 )
15511575
15521576# Code blocks don't have newline at the end,
0 commit comments