|
| 1 | + |
| 2 | +# VARIABLES # |
| 3 | + |
| 4 | +# On Mac OSX, in order to use `|` and other regular expression operators, we need to use enhanced regular expression syntax (-E); see https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man7/re_format.7.html#//apple_ref/doc/man/7/re_format. |
| 5 | + |
| 6 | +ifeq ($(KERNEL), Darwin) |
| 7 | + TESTS_FIXTURES ?= $(shell find -E $(ROOT) \ |
| 8 | + -name "$(TESTS_FIXTURES_PATTERN)" \ |
| 9 | + -path "$(ROOT)/**/$(TESTS_FIXTURES_DIR)/**" \ |
| 10 | + -regex "$(TESTS_FIXTURES_FILTER)" \ |
| 11 | + -not -path "$(ROOT)/.*" \ |
| 12 | + -not -path "$(NODE_MODULES)/*" \ |
| 13 | + -not -path "$(TOOLS_DIR)/*" \ |
| 14 | + -not -path "$(BUILD_DIR)/*" \ |
| 15 | + -not -path "$(REPORTS_DIR)/*" \ |
| 16 | + ) |
| 17 | +else |
| 18 | + TESTS_FIXTURES ?= $(shell find $(ROOT) \ |
| 19 | + -name "$(TESTS_FIXTURES_PATTERN)" \ |
| 20 | + -path "$(ROOT)/**/$(TESTS_FIXTURES_DIR)/**" \ |
| 21 | + -regextype posix-extended \ |
| 22 | + -regex "$(TESTS_FIXTURES_FILTER)" \ |
| 23 | + -not -path "$(ROOT)/.*" \ |
| 24 | + -not -path "$(NODE_MODULES)/*" \ |
| 25 | + -not -path "$(TOOLS_DIR)/*" \ |
| 26 | + -not -path "$(BUILD_DIR)/*" \ |
| 27 | + -not -path "$(REPORTS_DIR)/*" \ |
| 28 | + ) |
| 29 | +endif |
| 30 | + |
| 31 | + |
| 32 | +# TARGETS # |
| 33 | + |
| 34 | +# List test fixture files. |
| 35 | +# |
| 36 | +# This target prints a newline-delimited list of test fixture files. |
| 37 | + |
| 38 | +list-test-fixtures: |
| 39 | + @printf '%s\n' $(TESTS_FIXTURES) |
| 40 | + |
| 41 | + |
| 42 | +.PHONY: list-test-fixtures |
0 commit comments