Skip to content

Commit 0127712

Browse files
joyeecheungtargos
authored andcommitted
build: introduce make jstest
Add a `make jstest` target that runs tests written in JavaScript (excluding documentation tests which are run in `make test-doc`). PR-URL: #19324 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Matheus Marchini <[email protected]>
1 parent 92e9ed0 commit 0127712

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

Makefile

+16-12
Original file line numberDiff line numberDiff line change
@@ -236,36 +236,40 @@ v8:
236236
tools/make-v8.sh
237237
$(MAKE) -C deps/v8 $(V8_ARCH).$(BUILDTYPE_LOWER) $(V8_BUILD_OPTIONS)
238238

239+
.PHONY: jstest
240+
jstest: build-addons build-addons-napi ## Runs addon tests and JS tests
241+
$(PYTHON) tools/test.py --mode=release -J \
242+
$(CI_JS_SUITES) \
243+
$(CI_NATIVE_SUITES)
244+
239245
.PHONY: test
240246
# This does not run tests of third-party libraries inside deps.
241247
test: all ## Runs default tests, linters, and builds docs.
248+
# Build the addons before running the tests so the test results
249+
# can be displayed together
242250
$(MAKE) -s build-addons
243251
$(MAKE) -s build-addons-napi
244-
$(MAKE) -s doc-only
245-
$(MAKE) -s lint
252+
$(MAKE) -s test-doc
246253
$(MAKE) -s cctest
247-
$(PYTHON) tools/test.py --mode=release -J \
248-
$(CI_JS_SUITES) \
249-
$(CI_NATIVE_SUITES) \
250-
$(CI_DOC)
254+
$(MAKE) -s jstest
251255

252256
.PHONY: test-only
253257
test-only: all ## For a quick test, does not run linter or build docs.
258+
# Build the addons before running the tests so the test results
259+
# can be displayed together
254260
$(MAKE) build-addons
255261
$(MAKE) build-addons-napi
256262
$(MAKE) cctest
257-
$(PYTHON) tools/test.py --mode=release -J \
258-
$(CI_JS_SUITES) \
259-
$(CI_NATIVE_SUITES)
263+
$(MAKE) jstest
260264

261265
# Used by `make coverage-test`
262266
test-cov: all
267+
# Build the addons before running the tests so the test results
268+
# can be displayed together
263269
$(MAKE) build-addons
264270
$(MAKE) build-addons-napi
265271
# $(MAKE) cctest
266-
$(PYTHON) tools/test.py --mode=release -J \
267-
$(CI_JS_SUITES) \
268-
$(CI_NATIVE_SUITES)
272+
$(MAKE) jstest
269273
$(MAKE) lint
270274

271275
test-parallel: all

0 commit comments

Comments
 (0)