|
20 | 20 |
|
21 | 21 | ifeq ($(JAVASCRIPT_CODE_INSTRUMENTER), istanbul) |
22 | 22 | 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 |
23 | 27 | endif |
24 | 28 |
|
25 | 29 |
|
26 | | -# TARGETS # |
| 30 | +# RULES # |
27 | 31 |
|
28 | | -# Run unit tests and generate a test coverage report. |
| 32 | +#/ |
| 33 | +# Runs unit tests and generates a test coverage report. |
29 | 34 | # |
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 | +#/ |
32 | 51 | test-javascript-cov: clean-javascript-cov |
33 | 52 | ifeq ($(JAVASCRIPT_CODE_INSTRUMENTER), istanbul) |
34 | 53 | $(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 |
35 | 58 | endif |
36 | 59 |
|
37 | 60 | .PHONY: test-javascript-cov |
38 | 61 |
|
39 | | - |
40 | | -# View a test coverage report. |
| 62 | +#/ |
| 63 | +# Opens an HTML test coverage report in a local web browser. |
41 | 64 | # |
42 | | -# This target opens an HTML JavaScript coverage report in a local web browser. |
43 | | - |
| 65 | +# @example |
| 66 | +# make view-javascript-cov |
| 67 | +#/ |
44 | 68 | view-javascript-cov: |
45 | 69 | ifeq ($(JAVASCRIPT_CODE_INSTRUMENTER), istanbul) |
46 | 70 | $(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 |
47 | 75 | endif |
48 | 76 |
|
49 | 77 | .PHONY: view-javascript-cov |
50 | 78 |
|
51 | | - |
52 | | -# Remove a coverage directory. |
| 79 | +#/ |
| 80 | +# Removes a JavaScript coverage directory. |
53 | 81 | # |
54 | | -# This target cleans up a JavaScript coverage directory by removing it entirely. |
55 | | - |
| 82 | +# @example |
| 83 | +# make clean-javascript-cov |
| 84 | +#/ |
56 | 85 | clean-javascript-cov: |
57 | 86 | $(QUIET) $(DELETE) $(DELETE_FLAGS) $(COVERAGE_DIR) |
58 | 87 |
|
|
0 commit comments