Skip to content

Commit 5d4cdb2

Browse files
committed
Document rules
1 parent deee50f commit 5d4cdb2

File tree

1 file changed

+41
-12
lines changed

1 file changed

+41
-12
lines changed

tools/make/lib/test-cov/javascript.mk

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,39 +20,68 @@
2020

2121
ifeq ($(JAVASCRIPT_CODE_INSTRUMENTER), istanbul)
2222
include $(TOOLS_MAKE_LIB_DIR)/test-cov/istanbul.mk
23+
else
24+
ifeq ($(JAVASCRIPT_CODE_INSTRUMENTER), c8)
25+
include $(TOOLS_MAKE_LIB_DIR)/test-cov/c8.mk
26+
endif
2327
endif
2428

2529

26-
# TARGETS #
30+
# RULES #
2731

28-
# Run unit tests and generate a test coverage report.
32+
#/
33+
# Runs unit tests and generates a test coverage report.
2934
#
30-
# This target instruments JavaScript source code, runs unit tests, and outputs a test coverage report.
31-
35+
# ## Notes
36+
#
37+
# - Raw TAP output is piped to a TAP reporter.
38+
# - This command is useful when wanting to glob for JavaScript test files (e.g., generate a test coverage report for all JavaScript tests for a particular package).
39+
#
40+
# @param {string} [TESTS_FILTER] - file path pattern (e.g., `.*/blas/base/dasum/.*`)
41+
# @param {string} [JAVASCRIPT_CODE_INSTRUMENTER] - JavaScript code instrumenter
42+
# @param {*} [FAST_FAIL] - flag indicating whether to stop running tests upon encountering a test failure
43+
#
44+
#
45+
# @example
46+
# make test-javascript-cov
47+
#
48+
# @example
49+
# make test-javascript-cov TESTS_FILTER=".*/blas/base/dasum/.*"
50+
#/
3251
test-javascript-cov: clean-javascript-cov
3352
ifeq ($(JAVASCRIPT_CODE_INSTRUMENTER), istanbul)
3453
$(QUIET) NODE_ENV_TEST="$(NODE_ENV_TEST)" NODE_PATH_TEST="$(NODE_PATH_TEST)" $(MAKE) -f $(this_file) test-istanbul
54+
else
55+
ifeq ($(JAVASCRIPT_CODE_INSTRUMENTER), c8)
56+
$(QUIET) NODE_ENV_TEST="$(NODE_ENV_TEST)" NODE_PATH_TEST="$(NODE_PATH_TEST)" $(MAKE) -f $(this_file) test-c8
57+
endif
3558
endif
3659

3760
.PHONY: test-javascript-cov
3861

39-
40-
# View a test coverage report.
62+
#/
63+
# Opens an HTML test coverage report in a local web browser.
4164
#
42-
# This target opens an HTML JavaScript coverage report in a local web browser.
43-
65+
# @example
66+
# make view-javascript-cov
67+
#/
4468
view-javascript-cov:
4569
ifeq ($(JAVASCRIPT_CODE_INSTRUMENTER), istanbul)
4670
$(QUIET) $(MAKE) -f $(this_file) view-istanbul-report
71+
else
72+
ifeq ($(JAVASCRIPT_CODE_INSTRUMENTER), c8)
73+
$(QUIET) $(MAKE) -f $(this_file) view-c8-report
74+
endif
4775
endif
4876

4977
.PHONY: view-javascript-cov
5078

51-
52-
# Remove a coverage directory.
79+
#/
80+
# Removes a JavaScript coverage directory.
5381
#
54-
# This target cleans up a JavaScript coverage directory by removing it entirely.
55-
82+
# @example
83+
# make clean-javascript-cov
84+
#/
5685
clean-javascript-cov:
5786
$(QUIET) $(DELETE) $(DELETE_FLAGS) $(COVERAGE_DIR)
5887

0 commit comments

Comments
 (0)