270
270
tools/make-v8.sh $(V8_ARCH ) .$(BUILDTYPE_LOWER ) $(V8_BUILD_OPTIONS )
271
271
272
272
.PHONY : jstest
273
- jstest : build-addons build-addons-napi # # Runs addon tests and JS tests
273
+ jstest : build-addons build-js-native-api-tests build-node-api-tests # # Runs addon tests and JS tests
274
274
$(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) \
275
275
--skip-tests=$(CI_SKIP_TESTS ) \
276
276
$(CI_JS_SUITES ) \
@@ -281,21 +281,24 @@ jstest: build-addons build-addons-napi ## Runs addon tests and JS tests
281
281
test : all # # Runs default tests, linters, and builds docs.
282
282
$(MAKE ) -s test-doc
283
283
$(MAKE ) -s build-addons
284
- $(MAKE ) -s build-addons-napi
284
+ $(MAKE ) -s build-js-native-api-tests
285
+ $(MAKE ) -s build-node-api-tests
285
286
$(MAKE ) -s cctest
286
287
$(MAKE ) -s jstest
287
288
288
289
.PHONY : test-only
289
290
test-only : all # # For a quick test, does not run linter or build docs.
290
291
$(MAKE ) build-addons
291
- $(MAKE ) build-addons-napi
292
+ $(MAKE ) build-js-native-api-tests
293
+ $(MAKE ) build-node-api-tests
292
294
$(MAKE ) cctest
293
295
$(MAKE ) jstest
294
296
295
297
# Used by `make coverage-test`
296
298
test-cov : all
297
299
$(MAKE ) build-addons
298
- $(MAKE ) build-addons-napi
300
+ $(MAKE ) build-js-native-api-tests
301
+ $(MAKE ) build-node-api-tests
299
302
# $(MAKE) cctest
300
303
CI_SKIP_TESTS=core_line_numbers.js $(MAKE ) jstest
301
304
@@ -381,30 +384,55 @@ test/addons/.buildstamp: $(ADDONS_PREREQS) \
381
384
# TODO(bnoordhuis) Force rebuild after gyp update.
382
385
build-addons : | $(NODE_EXE ) test/addons/.buildstamp
383
386
384
- ADDONS_NAPI_BINDING_GYPS := \
385
- $(filter-out test/addons-napi /??_* /binding.gyp, \
386
- $(wildcard test/addons-napi /* /binding.gyp) )
387
+ JS_NATIVE_API_BINDING_GYPS := \
388
+ $(filter-out test/js-native-api /??_* /binding.gyp, \
389
+ $(wildcard test/js-native-api /* /binding.gyp) )
387
390
388
- ADDONS_NAPI_BINDING_SOURCES := \
389
- $(filter-out test/addons-napi /??_* /* .c, $(wildcard test/addons-napi /* /* .c) ) \
390
- $(filter-out test/addons-napi /??_* /* .cc, $(wildcard test/addons-napi /* /* .cc) ) \
391
- $(filter-out test/addons-napi /??_* /* .h, $(wildcard test/addons-napi /* /* .h) )
391
+ JS_NATIVE_API_BINDING_SOURCES := \
392
+ $(filter-out test/js-native-api /??_* /* .c, $(wildcard test/js-native-api /* /* .c) ) \
393
+ $(filter-out test/js-native-api /??_* /* .cc, $(wildcard test/js-native-api /* /* .cc) ) \
394
+ $(filter-out test/js-native-api /??_* /* .h, $(wildcard test/js-native-api /* /* .h) )
392
395
393
- # Implicitly depends on $(NODE_EXE), see the build-addons-napi rule for rationale.
394
- test/addons-napi /.buildstamp : $(ADDONS_PREREQS ) \
395
- $(ADDONS_NAPI_BINDING_GYPS ) $(ADDONS_NAPI_BINDING_SOURCES ) \
396
+ # Implicitly depends on $(NODE_EXE), see the build-js-native-api-tests rule for rationale.
397
+ test/js-native-api /.buildstamp : $(ADDONS_PREREQS ) \
398
+ $(JS_NATIVE_API_BINDING_GYPS ) $(JS_NATIVE_API_BINDING_SOURCES ) \
396
399
src/node_api.h src/node_api_types.h src/js_native_api.h \
397
400
src/js_native_api_types.h src/js_native_api_v8.h src/js_native_api_v8_internals.h
398
- @$(call run_build_addons,"$$PWD/test/addons-napi ",$@ )
401
+ @$(call run_build_addons,"$$PWD/test/js-native-api ",$@ )
399
402
400
- .PHONY : build-addons-napi
403
+ .PHONY : build-js-native-api-tests
401
404
# .buildstamp needs $(NODE_EXE) but cannot depend on it
402
405
# directly because it calls make recursively. The parent make cannot know
403
406
# if the subprocess touched anything so it pessimistically assumes that
404
407
# .buildstamp is out of date and need a rebuild.
405
408
# Just goes to show that recursive make really is harmful...
406
409
# TODO(bnoordhuis) Force rebuild after gyp or node-gyp update.
407
- build-addons-napi : | $(NODE_EXE ) test/addons-napi/.buildstamp
410
+ build-js-native-api-tests : | $(NODE_EXE ) test/js-native-api/.buildstamp
411
+
412
+ NODE_API_BINDING_GYPS := \
413
+ $(filter-out test/node-api/??_* /binding.gyp, \
414
+ $(wildcard test/node-api/* /binding.gyp) )
415
+
416
+ NODE_API_BINDING_SOURCES := \
417
+ $(filter-out test/node-api/??_* /* .c, $(wildcard test/node-api/* /* .c) ) \
418
+ $(filter-out test/node-api/??_* /* .cc, $(wildcard test/node-api/* /* .cc) ) \
419
+ $(filter-out test/node-api/??_* /* .h, $(wildcard test/node-api/* /* .h) )
420
+
421
+ # Implicitly depends on $(NODE_EXE), see the build-node-api-tests rule for rationale.
422
+ test/node-api/.buildstamp : $(ADDONS_PREREQS ) \
423
+ $(NODE_API_BINDING_GYPS ) $(NODE_API_BINDING_SOURCES ) \
424
+ src/node_api.h src/node_api_types.h src/js_native_api.h \
425
+ src/js_native_api_types.h src/js_native_api_v8.h src/js_native_api_v8_internals.h
426
+ @$(call run_build_addons,"$$PWD/test/node-api",$@ )
427
+
428
+ .PHONY : build-node-api-tests
429
+ # .buildstamp needs $(NODE_EXE) but cannot depend on it
430
+ # directly because it calls make recursively. The parent make cannot know
431
+ # if the subprocess touched anything so it pessimistically assumes that
432
+ # .buildstamp is out of date and need a rebuild.
433
+ # Just goes to show that recursive make really is harmful...
434
+ # TODO(bnoordhuis) Force rebuild after gyp or node-gyp update.
435
+ build-node-api-tests : | $(NODE_EXE ) test/node-api/.buildstamp
408
436
409
437
.PHONY : clear-stalled
410
438
clear-stalled :
@@ -415,9 +443,11 @@ clear-stalled:
415
443
echo $$ {PS_OUT} | xargs kill -9; \
416
444
fi
417
445
418
- test-build : | all build-addons build-addons-napi
446
+ test-build : | all build-addons build-js-native-api-tests build-node-api-tests
419
447
420
- test-build-addons-napi : all build-addons-napi
448
+ test-build-js-native-api : all build-js-native-api-tests
449
+
450
+ test-build-node-api : all build-node-api-tests
421
451
422
452
.PHONY : test-all
423
453
test-all : test-build # # Run everything in test/.
@@ -426,15 +456,15 @@ test-all: test-build ## Run everything in test/.
426
456
test-all-valgrind : test-build
427
457
$(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=debug,release --valgrind
428
458
429
- CI_NATIVE_SUITES ?= addons addons-napi
459
+ CI_NATIVE_SUITES ?= addons js-native-api node-api
430
460
CI_JS_SUITES ?= default
431
461
CI_DOC := doctool
432
462
433
463
.PHONY : test-ci-native
434
464
# Build and test addons without building anything else
435
465
# Related CI job: node-test-commit-arm-fanned
436
466
test-ci-native : LOGLEVEL := info
437
- test-ci-native : | test/addons/.buildstamp test/addons-napi /.buildstamp
467
+ test-ci-native : | test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api /.buildstamp
438
468
$(PYTHON ) tools/test.py $(PARALLEL_ARGS ) -p tap --logfile test.tap \
439
469
--mode=$(BUILDTYPE_LOWER ) --flaky-tests=$(FLAKY_TESTS ) \
440
470
$(TEST_CI_ARGS ) $(CI_NATIVE_SUITES )
@@ -456,7 +486,7 @@ test-ci-js: | clear-stalled
456
486
.PHONY : test-ci
457
487
# Related CI jobs: most CI tests, excluding node-test-commit-arm-fanned
458
488
test-ci : LOGLEVEL := info
459
- test-ci : | clear-stalled build-addons build-addons-napi doc-only
489
+ test-ci : | clear-stalled build-addons build-js-native-api-tests build-node-api-tests doc-only
460
490
out/Release/cctest --gtest_output=tap:cctest.tap
461
491
$(PYTHON ) tools/test.py $(PARALLEL_ARGS ) -p tap --logfile test.tap \
462
492
--mode=$(BUILDTYPE_LOWER ) --flaky-tests=$(FLAKY_TESTS ) \
@@ -539,32 +569,43 @@ test-npm: $(NODE_EXE) ## Run the npm test suite on deps/npm.
539
569
test-npm-publish : $(NODE_EXE )
540
570
npm_package_config_publishtest=true $(NODE ) deps/npm/test/run.js
541
571
542
- .PHONY : test-addons-napi
543
- test-addons-napi : test-build-addons-napi
544
- $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) addons-napi
572
+ .PHONY : test-js-native-api
573
+ test-js-native-api : test-build-js-native-api
574
+ $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) js-native-api
575
+
576
+ .PHONY : test-js-native-api-clean
577
+ test-js-native-api-clean :
578
+ $(RM ) -r test/js-native-api/* /build
579
+ $(RM ) test/js-native-api/.buildstamp
580
+
581
+ .PHONY : test-node-api
582
+ test-node-api : test-build-node-api
583
+ $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) node-api
545
584
546
- .PHONY : test-addons-napi -clean
547
- test-addons-napi -clean :
548
- $(RM ) -r test/addons-napi /* /build
549
- $(RM ) test/addons-napi /.buildstamp
585
+ .PHONY : test-node-api -clean
586
+ test-node-api -clean :
587
+ $(RM ) -r test/node-api /* /build
588
+ $(RM ) test/node-api /.buildstamp
550
589
551
590
.PHONY : test-addons
552
- test-addons : test-build test-addons-napi
591
+ test-addons : test-build test-js-native-api test-node-api
553
592
$(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) addons
554
593
555
594
.PHONY : test-addons-clean
556
595
test-addons-clean :
557
596
$(RM ) -r test/addons/?? _* /
558
597
$(RM ) -r test/addons/* /build
559
598
$(RM ) test/addons/.buildstamp test/addons/.docbuildstamp
560
- $(MAKE ) test-addons-napi-clean
599
+ $(MAKE ) test-js-native-api-clean
600
+ $(MAKE ) test-node-api-clean
561
601
562
602
test-async-hooks :
563
603
$(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) async-hooks
564
604
565
605
test-with-async-hooks :
566
606
$(MAKE ) build-addons
567
- $(MAKE ) build-addons-napi
607
+ $(MAKE ) build-js-native-api-tests
608
+ $(MAKE ) build-node-api-tests
568
609
$(MAKE ) cctest
569
610
NODE_TEST_WITH_ASYNC_HOOKS=1 $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) \
570
611
$(CI_JS_SUITES ) \
@@ -1136,7 +1177,7 @@ LINT_CPP_ADDON_DOC_FILES = $(wildcard $(LINT_CPP_ADDON_DOC_FILES_GLOB))
1136
1177
LINT_CPP_EXCLUDE ?=
1137
1178
LINT_CPP_EXCLUDE += src/node_root_certs.h
1138
1179
LINT_CPP_EXCLUDE += $(LINT_CPP_ADDON_DOC_FILES )
1139
- LINT_CPP_EXCLUDE += $(wildcard test/addons-napi /??_* /* .cc test/addons-napi /??_* /* .h)
1180
+ LINT_CPP_EXCLUDE += $(wildcard test/js-native-api /??_* /* .cc test/js-native-api/??_ * / * .h test/node-api/??_ * / * .cc test/node-api /??_* /* .h)
1140
1181
# These files were copied more or less verbatim from V8.
1141
1182
LINT_CPP_EXCLUDE += src/tracing/trace_event.h src/tracing/trace_event_common.h
1142
1183
@@ -1152,8 +1193,10 @@ LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \
1152
1193
test/addons/* /* .h \
1153
1194
test/cctest/* .cc \
1154
1195
test/cctest/* .h \
1155
- test/addons-napi/* /* .cc \
1156
- test/addons-napi/* /* .h \
1196
+ test/js-native-api/* /* .cc \
1197
+ test/js-native-api/* /* .h \
1198
+ test/node-api/* /* .cc \
1199
+ test/node-api/* /* .h \
1157
1200
tools/icu/* .cc \
1158
1201
tools/icu/* .h \
1159
1202
) )
0 commit comments