Skip to content

Commit

Permalink
build: remove files coverage make commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Planeshifter committed Aug 2, 2023
1 parent 72d83fd commit 86c3668
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 133 deletions.
13 changes: 0 additions & 13 deletions tools/make/lib/test-cov/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,3 @@ view-cov: view-javascript-cov
clean-cov: clean-javascript-cov

.PHONY: clean-cov

#/
# Runs a specified list of files containing unit tests and generates a test coverage report.
#
# @param {string} FILES - list of test file paths
# @param {*} [FAST_FAIL] - flag indicating whether to stop running tests upon encountering a test failure
#
# @example
# make test-cov-files FILES='/foo/test.js /bar/test.js'
#/
test-cov-files: test-javascript-cov-files

.PHONY: test-cov-files
30 changes: 0 additions & 30 deletions tools/make/lib/test-cov/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,6 @@ The command supports the following environment variables:
$ make test-cov TESTS_FILTER='.*/blas/base/dasum/.*'
```

#### test-cov-files

Runs a specified list of files containing unit tests and generates a test coverage report.

<!-- run-disable -->

```bash
$ make test-cov-files FILES='/foo/test.js /bar/test.js'
```

The command supports the following environment variables:

- **FAST_FAIL**: flag indicating whether to stop running tests upon encountering a test failure.
- **FILES**: list of test file paths.

#### view-cov

Opens an HTML test coverage report in a local web browser.
Expand Down Expand Up @@ -125,21 +110,6 @@ The command supports the following environment variables:
$ make test-javascript-cov TESTS_FILTER='.*/blas/base/dasum/.*'
```

#### test-javascript-cov-files

Runs a specified list of files containing JavaScript unit tests and generates a test coverage report.

<!-- run-disable -->

```bash
$ make test-javascript-cov-files FILES='/foo/test.js /bar/test.js'
```

The command supports the following environment variables:

- **FAST_FAIL**: flag indicating whether to stop running tests upon encountering a test failure.
- **FILES**: list of test file paths.

#### view-javascript-cov

Opens an HTML test coverage report in a local web browser.
Expand Down
37 changes: 0 additions & 37 deletions tools/make/lib/test-cov/c8.mk
Original file line number Diff line number Diff line change
Expand Up @@ -114,40 +114,3 @@ view-c8-report:
$(QUIET) $(OPEN) $(C8_HTML_REPORT)

.PHONY: view-c8-report

#/
# Runs specified unit tests and generates a test coverage report.
#
# ## Notes
#
# - Raw TAP output is piped to a TAP reporter.
# - This command is useful when wanting to specify JavaScript test files.
#
#
# @private
# @param {string} [FILES] - space separated list of test files
# @param {*} [FAST_FAIL] - flag indicating whether to stop running tests upon encountering a test failure
#
# @example
# make test-c8-files FILES="test/one.js test/two.js"
#/
test-c8-files: $(NODE_MODULES)
ifeq ($(FAIL_FAST), true)
$(foreach file, $(FILES), \
echo "Running test: $(file)"; \
NODE_ENV="$(NODE_ENV_TEST)" \
NODE_PATH="$(NODE_PATH_TEST)" \
TEST_MODE=coverage \
$(C8) $(C8_FLAGS) $(NODE) $(file) | $(TAP_REPORTER) || exit 1; \
)
else
$(foreach file, $(FILES), \
echo "Running test: $(file)"; \
NODE_ENV="$(NODE_ENV_TEST)" \
NODE_PATH="$(NODE_PATH_TEST)" \
TEST_MODE=coverage \
$(C8) $(C8_FLAGS) $(NODE) $(file) | $(TAP_REPORTER) || echo 'Tests failed.'; \
)
endif

.PHONY: test-c8-files
32 changes: 0 additions & 32 deletions tools/make/lib/test-cov/istanbul.mk
Original file line number Diff line number Diff line change
Expand Up @@ -262,35 +262,3 @@ clean-istanbul-instrument:
$(QUIET) $(DELETE) $(DELETE_FLAGS) $(COVERAGE_INSTRUMENTATION_DIR)

.PHONY: clean-istanbul-instrument

#/
# Runs unit tests and generates a test coverage report for a list of JavaScript test files.
#
# @param {string} [FILES] - space-separated list of JavaScript test files
# @param {*} [FAST_FAIL] - flag indicating whether to stop running tests upon encountering a test failure
#
# @private
#
# @example
# make test-istanbul-files FILES='./lib/foo.js ./lib/bar.js'
#/
test-istanbul-files: $(NODE_MODULES) test-istanbul-instrument
$(QUIET) $(MKDIR_RECURSIVE) $(COVERAGE_DIR)
$(QUIET) $(MAKE_EXECUTABLE) $(COVERAGE_REPORT_NAME)
$(QUIET) for file in $(FILES); do \
test_dir=$(ISTANBUL_INSTRUMENT_OUT)/$$(dirname $$file); \
echo ''; \
echo "Running tests for file: $$file"; \
echo ''; \
NODE_ENV="$(NODE_ENV_TEST)" \
NODE_PATH="$(NODE_PATH_TEST)" \
TEST_MODE=coverage \
$(ISTANBUL_TEST_RUNNER) \
$(ISTANBUL_TEST_RUNNER_FLAGS) \
--output $$($(COVERAGE_REPORT_NAME) $(ISTANBUL_INSTRUMENT_OUT) $$test_dir $(COVERAGE_DIR)) \
"$$test_dir/**/$(basename $$file)" \
| $(TAP_REPORTER) || exit 1; \
done
$(QUIET) $(MAKE) -f $(this_file) test-istanbul-report

.PHONY: test-istanbul-files
21 changes: 0 additions & 21 deletions tools/make/lib/test-cov/javascript.mk
Original file line number Diff line number Diff line change
Expand Up @@ -85,24 +85,3 @@ clean-javascript-cov:
$(QUIET) $(DELETE) $(DELETE_FLAGS) $(COVERAGE_DIR)

.PHONY: clean-javascript-cov

#/
# Runs a specified list of files containing JavaScript unit tests and generates a test coverage report.
#
# @param {string} FILES - list of JavaScript test file paths
# @param {string} [JAVASCRIPT_CODE_INSTRUMENTER] - JavaScript code instrumenter
# @param {*} [FAST_FAIL] - flag indicating whether to stop running tests upon encountering a test failure
#
# @example
# make test-javascript-cov-files FILES='/foo/test.js /bar/test.js'
#/
test-javascript-cov-files: clean-javascript-cov
ifeq ($(JAVASCRIPT_CODE_INSTRUMENTER), istanbul)
$(QUIET) NODE_ENV_TEST="$(NODE_ENV_TEST)" NODE_PATH_TEST="$(NODE_PATH_TEST)" FILES="$(FILES)" $(MAKE) -f $(this_file) test-istanbul-files
else
ifeq ($(JAVASCRIPT_CODE_INSTRUMENTER), c8)
$(QUIET) NODE_ENV_TEST="$(NODE_ENV_TEST)" NODE_PATH_TEST="$(NODE_PATH_TEST)" FILES="$(FILES)" $(MAKE) -f $(this_file) test-c8-files
endif
endif

.PHONY: test-javascript-cov-files

0 comments on commit 86c3668

Please sign in to comment.