Skip to content

Commit d75daf6

Browse files
committed
Add rule to list tools tests fixtures
1 parent 9504b66 commit d75daf6

2 files changed

Lines changed: 57 additions & 0 deletions

File tree

tools/make/lib/ls/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,13 @@ FIND_TOOLS_TESTS_DIRS_EXCLUDE_FLAGS ?= \
330330
-not -path "*/snippets/*" \
331331
-not -path "*/make/lib/*"
332332

333+
# Tools tests fixtures exclude flags:
334+
FIND_TOOLS_TESTS_FIXTURES_EXCLUDE_FLAGS ?= \
335+
-not -path "$(TOOLS_DIR)/test" \
336+
-not -path "$(TOOLS_PKGS_DIR)/test" \
337+
-not -path "*/snippets/*" \
338+
-not -path "*/make/lib/*"
339+
333340
# 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.
334341
ifeq ($(OS), Darwin)
335342
find_kernel_prefix := -E
@@ -358,4 +365,5 @@ include $(TOOLS_MAKE_LIB_DIR)/ls/svg_equations.mk
358365
include $(TOOLS_MAKE_LIB_DIR)/ls/tests_directories.mk
359366
include $(TOOLS_MAKE_LIB_DIR)/ls/tests_fixtures.mk
360367
include $(TOOLS_MAKE_LIB_DIR)/ls/tools_tests_directories.mk
368+
include $(TOOLS_MAKE_LIB_DIR)/ls/tools_tests_fixtures.mk
361369
include $(TOOLS_MAKE_LIB_DIR)/ls/wasm/Makefile
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#/
2+
# @license Apache-2.0
3+
#
4+
# Copyright (c) 2017 The Stdlib Authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#/
18+
19+
# VARIABLES #
20+
21+
# Define the command flags:
22+
FIND_TOOLS_TESTS_FIXTURES_FLAGS ?= \
23+
-type f \
24+
-name "$(TESTS_FIXTURES_PATTERN)" \
25+
-path "*/$(TESTS_FIXTURES_FOLDER)/**" \
26+
-regex "$(TESTS_FIXTURES_FILTER)" \
27+
$(FIND_TOOLS_TESTS_FIXTURES_EXCLUDE_FLAGS)
28+
29+
ifneq ($(OS), Darwin)
30+
FIND_TOOLS_TESTS_FIXTURES_FLAGS := -regextype posix-extended $(FIND_TOOLS_TESTS_FIXTURES_FLAGS)
31+
endif
32+
33+
# Define a command to list files:
34+
FIND_TOOLS_TESTS_FIXTURES_CMD ?= find $(find_kernel_prefix) $(TOOLS_DIR) $(TOOLS_PKGS_DIR) $(FIND_TOOLS_TESTS_FIXTURES_FLAGS)
35+
36+
# Define the list of files:
37+
TOOLS_TESTS_FIXTURES ?= $(shell $(FIND_TOOLS_TESTS_FIXTURES_CMD))
38+
39+
40+
# TARGETS #
41+
42+
# List test fixture files.
43+
#
44+
# This target prints a newline-delimited list of test fixture files.
45+
46+
list-tools-tests-fixtures:
47+
$(QUIET) find $(find_kernel_prefix) $(TOOLS_DIR) $(TOOLS_PKGS_DIR) $(FIND_TOOLS_TESTS_FIXTURES_FLAGS) $(find_print_list)
48+
49+
.PHONY: list-tools-tests-fixtures

0 commit comments

Comments
 (0)