@@ -294,7 +294,6 @@ coverage-report-js: ## Report JavaScript coverage results.
294294cctest : all # # Run the C++ tests using the built `cctest` executable.
295295 @out/$(BUILDTYPE ) /$@ --gtest_filter=$(GTEST_FILTER )
296296 $(NODE ) ./test/embedding/test-embedding.js
297- $(NODE ) ./test/sqlite/test-sqlite-extensions.mjs
298297
299298.PHONY : list-gtests
300299list-gtests : # # List all available C++ gtests.
@@ -312,7 +311,7 @@ v8: ## Build deps/v8.
312311 tools/make-v8.sh $(V8_ARCH ) .$(BUILDTYPE_LOWER ) $(V8_BUILD_OPTIONS )
313312
314313.PHONY : jstest
315- jstest : build-addons build-js-native-api-tests build-node-api-tests # # Run addon tests and JS tests.
314+ jstest : build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests # # Run addon tests and JS tests.
316315 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) \
317316 $(TEST_CI_ARGS ) \
318317 --skip-tests=$(CI_SKIP_TESTS ) \
@@ -338,6 +337,7 @@ test: all ## Run default tests, linters, and build docs.
338337 $(MAKE ) -s build-addons
339338 $(MAKE ) -s build-js-native-api-tests
340339 $(MAKE ) -s build-node-api-tests
340+ $(MAKE ) -s build-sqlite-tests
341341 $(MAKE ) -s cctest
342342 $(MAKE ) -s jstest
343343
@@ -346,6 +346,7 @@ test-only: all ## Run default tests, without linters or building the docs.
346346 $(MAKE ) build-addons
347347 $(MAKE ) build-js-native-api-tests
348348 $(MAKE ) build-node-api-tests
349+ $(MAKE ) build-sqlite-tests
349350 $(MAKE ) cctest
350351 $(MAKE ) jstest
351352 $(MAKE ) tooltest
@@ -356,6 +357,7 @@ test-cov: all ## Run coverage tests.
356357 $(MAKE ) build-addons
357358 $(MAKE ) build-js-native-api-tests
358359 $(MAKE ) build-node-api-tests
360+ $(MAKE ) build-sqlite-tests
359361 $(MAKE ) cctest
360362 CI_SKIP_TESTS=$(COV_SKIP_TESTS ) $(MAKE ) jstest
361363
@@ -501,6 +503,23 @@ benchmark/napi/.buildstamp: $(ADDONS_PREREQS) \
501503 $(BENCHMARK_NAPI_BINDING_GYPS ) $(BENCHMARK_NAPI_BINDING_SOURCES )
502504 @$(call run_build_addons,"$$PWD/benchmark/napi",$@ )
503505
506+ SQLITE_BINDING_GYPS := $(wildcard test/sqlite/* /binding.gyp)
507+
508+ SQLITE_BINDING_SOURCES := \
509+ $(wildcard test/sqlite/* /* .c)
510+
511+ # Implicitly depends on $(NODE_EXE), see the build-sqlite-tests rule for rationale.
512+ test/sqlite/.buildstamp : $(ADDONS_PREREQS ) \
513+ $(SQLITE_BINDING_GYPS ) $(SQLITE_BINDING_SOURCES )
514+ @$(call run_build_addons,"$$PWD/test/sqlite",$@ )
515+
516+ .PHONY : build-sqlite-tests
517+ # .buildstamp needs $(NODE_EXE) but cannot depend on it
518+ # directly because it calls make recursively. The parent make cannot know
519+ # if the subprocess touched anything so it pessimistically assumes that
520+ # .buildstamp is out of date and need a rebuild.
521+ build-sqlite-tests : | $(NODE_EXE ) test/sqlite/.buildstamp # # Build SQLite tests.
522+
504523.PHONY : clear-stalled
505524clear-stalled : # # Clear any stalled processes.
506525 $(info Clean up any leftover processes but don't error if found.)
@@ -511,14 +530,18 @@ clear-stalled: ## Clear any stalled processes.
511530 fi
512531
513532.PHONY : test-build
514- test-build : | all build-addons build-js-native-api-tests build-node-api-tests # # Build all tests.
533+ test-build : | all build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests # # Build all tests.
515534
516535.PHONY : test-build-js-native-api
517536test-build-js-native-api : all build-js-native-api-tests # # Build JS Native-API tests.
518537
519538.PHONY : test-build-node-api
520539test-build-node-api : all build-node-api-tests # # Build Node-API tests.
521540
541+ .PHONY : test-build-sqlite
542+ test-build-sqlite : all build-sqlite-tests # # Build SQLite tests.
543+
544+
522545.PHONY : test-all
523546test-all : test-build # # Run default tests with both Debug and Release builds.
524547 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=debug,release
@@ -546,7 +569,7 @@ endif
546569
547570# Related CI job: node-test-commit-arm-fanned
548571test-ci-native : LOGLEVEL := info # # Build and test addons without building anything else.
549- test-ci-native : | benchmark/napi/.buildstamp test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp
572+ test-ci-native : | benchmark/napi/.buildstamp test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp test/sqlite/.buildstamp
550573 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) -p tap --logfile test.tap \
551574 --mode=$(BUILDTYPE_LOWER ) --flaky-tests=$(FLAKY_TESTS ) \
552575 $(TEST_CI_ARGS ) $(CI_NATIVE_SUITES )
@@ -569,13 +592,12 @@ test-ci-js: | clear-stalled ## Build and test JavaScript with building anything
569592.PHONY : test-ci
570593# Related CI jobs: most CI tests, excluding node-test-commit-arm-fanned
571594test-ci : LOGLEVEL := info # # Build and test everything (CI).
572- test-ci : | clear-stalled bench-addons-build build-addons build-js-native-api-tests build-node-api-tests doc-only
595+ test-ci : | clear-stalled bench-addons-build build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests doc-only
573596 out/Release/cctest --gtest_output=xml:out/junit/cctest.xml
574597 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) -p tap --logfile test.tap \
575598 --mode=$(BUILDTYPE_LOWER ) --flaky-tests=$(FLAKY_TESTS ) \
576599 $(TEST_CI_ARGS ) $(CI_JS_SUITES ) $(CI_NATIVE_SUITES ) $(CI_DOC )
577600 $(NODE ) ./test/embedding/test-embedding.js
578- $(NODE ) ./test/sqlite/test-sqlite-extensions.mjs
579601 $(info Clean up any leftover processes, error if found.)
580602 ps awwx | grep Release/node | grep -v grep | cat
581603 @PS_OUT=` ps awwx | grep Release/node | grep -v grep | awk ' {print $$1}' ` ; \
@@ -681,6 +703,16 @@ test-node-api-clean: ## Remove Node-API testing artifacts.
681703 $(RM ) -r test/node-api/* /build
682704 $(RM ) test/node-api/.buildstamp
683705
706+ .PHONY : test-sqlite
707+ test-sqlite : test-build-sqlite # # Run SQLite tests.
708+ $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) sqlite
709+
710+ .PHONY : test-sqlite-clean
711+ .NOTPARALLEL : test-sqlite-clean
712+ test-sqlite-clean : # # Remove SQLite testing artifacts.
713+ $(RM ) -r test/sqlite/* /build
714+ $(RM ) test/sqlite/.buildstamp
715+
684716.PHONY : test-addons
685717test-addons : test-build test-js-native-api test-node-api # # Run addon tests.
686718 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) addons
@@ -1446,7 +1478,7 @@ LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \
14461478 test/cctest/* .h \
14471479 test/embedding/* .cc \
14481480 test/embedding/* .h \
1449- test/sqlite/* .c \
1481+ test/sqlite/* / * .c \
14501482 test/fixtures/* .c \
14511483 test/js-native-api/* /* .cc \
14521484 test/node-api/* /* .cc \
@@ -1470,6 +1502,7 @@ FORMAT_CPP_FILES += $(wildcard \
14701502 test/js-native-api/* /* .h \
14711503 test/node-api/* /* .c \
14721504 test/node-api/* /* .h \
1505+ test/sqlite/* /* .c \
14731506 )
14741507
14751508# Code blocks don't have newline at the end,
0 commit comments