Skip to content

Commit 9276ebd

Browse files
committed
Add rule to list JavaScript test fixtures
1 parent 39f8f91 commit 9276ebd

File tree

3 files changed

+60
-8
lines changed

3 files changed

+60
-8
lines changed

tools/make/lib/ls/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ CPP_TESTS_FIXTURES_PATTERN ?= *.cpp
7575
# Define a filename pattern for Fortran test fixtures:
7676
FORTRAN_TESTS_FIXTURES_PATTERN ?= *.f
7777

78+
# Define a filename pattern for JavaScript test fixtures:
79+
JAVASCRIPT_TESTS_FIXTURES_PATTERN ?= *.js
80+
7881
# Define a filename pattern for Julia test fixtures:
7982
JULIA_TESTS_FIXTURES_PATTERN ?= *.jl
8083

tools/make/lib/ls/javascript/tests_fixtures.mk

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@
1919
# VARIABLES #
2020

2121
# Define the command flags:
22-
FIND_TESTS_FIXTURES_FLAGS ?= \
22+
FIND_JAVASCRIPT_TESTS_FIXTURES_FLAGS ?= \
2323
-type f \
24-
-name "$(TESTS_FIXTURES_PATTERN)" \
24+
-name "$(JAVASCRIPT_TESTS_FIXTURES_PATTERN)" \
2525
-path "$(ROOT_DIR)/**/$(TESTS_FIXTURES_FOLDER)/**" \
2626
-regex "$(TESTS_FIXTURES_FILTER)" \
2727
$(FIND_TESTS_FIXTURES_EXCLUDE_FLAGS)
2828

2929
ifneq ($(OS), Darwin)
30-
FIND_TESTS_FIXTURES_FLAGS := -regextype posix-extended $(FIND_TESTS_FIXTURES_FLAGS)
30+
FIND_JAVASCRIPT_TESTS_FIXTURES_FLAGS := -regextype posix-extended $(FIND_JAVASCRIPT_TESTS_FIXTURES_FLAGS)
3131
endif
3232

3333
# Define a command to list files:
34-
FIND_TESTS_FIXTURES_CMD ?= find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_TESTS_FIXTURES_FLAGS)
34+
FIND_JAVASCRIPT_TESTS_FIXTURES_CMD ?= find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_JAVASCRIPT_TESTS_FIXTURES_FLAGS)
3535

3636
# Define the list of files:
37-
TESTS_FIXTURES ?= $(shell $(FIND_TESTS_FIXTURES_CMD))
37+
JAVASCRIPT_TESTS_FIXTURES ?= $(shell $(FIND_JAVASCRIPT_TESTS_FIXTURES_CMD))
3838

3939

4040
# TARGETS #
@@ -43,7 +43,7 @@ TESTS_FIXTURES ?= $(shell $(FIND_TESTS_FIXTURES_CMD))
4343
#
4444
# This target prints a newline-delimited list of test fixture files.
4545

46-
list-tests-fixtures:
47-
$(QUIET) find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_TESTS_FIXTURES_FLAGS) $(find_print_list)
46+
list-tests-fixtures-javascript:
47+
$(QUIET) find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_JAVASCRIPT_TESTS_FIXTURES_FLAGS) $(find_print_list)
4848

49-
.PHONY: list-tests-fixtures
49+
.PHONY: list-tests-fixtures-javascript
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_TESTS_FIXTURES_FLAGS ?= \
23+
-type f \
24+
-name "$(TESTS_FIXTURES_PATTERN)" \
25+
-path "$(ROOT_DIR)/**/$(TESTS_FIXTURES_FOLDER)/**" \
26+
-regex "$(TESTS_FIXTURES_FILTER)" \
27+
$(FIND_TESTS_FIXTURES_EXCLUDE_FLAGS)
28+
29+
ifneq ($(OS), Darwin)
30+
FIND_TESTS_FIXTURES_FLAGS := -regextype posix-extended $(FIND_TESTS_FIXTURES_FLAGS)
31+
endif
32+
33+
# Define a command to list files:
34+
FIND_TESTS_FIXTURES_CMD ?= find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_TESTS_FIXTURES_FLAGS)
35+
36+
# Define the list of files:
37+
TESTS_FIXTURES ?= $(shell $(FIND_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-tests-fixtures:
47+
$(QUIET) find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_TESTS_FIXTURES_FLAGS) $(find_print_list)
48+
49+
.PHONY: list-tests-fixtures

0 commit comments

Comments
 (0)