-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
34 lines (27 loc) · 965 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# If make fails with "make: *** No rule to make target ..." then one of the
# input files is missing.
#
# To install bats:
# - cd ~/src
# - git clone https://github.com/bats-core/bats-core.git
# - git clone https://github.com/bats-core/bats-assert.git
# - git clone https://github.com/bats-core/bats-file
# - git clone https://github.com/bats-core/bats-support.git
TEST_PROGRAMS = $(wildcard test/*.bats)
TIMESTAMP_FILES = $(patsubst test/%.bats, test/.%.timestamp, $(TEST_PROGRAMS))
KCOVERAGE_DIR = $(HOME)/tmp/kcoverage
BATS = $(HOME)/src/bats-core/bin/bats
.PHONY: all clean coverage tests
all: bats_tests
bats_tests: $(TIMESTAMP_FILES)
clean:
rm -f $(TIMESTAMP_FILES)
rm -rf $(KCOVERAGE_DIR)
test/.%.timestamp: test/%.bats %
rm -f $@
run-if-exists $(BATS) ./$<
touch $@
bats_coverage: clean
KCOVERAGE_DIR=$(KCOVERAGE_DIR) make bats_tests
bats_coverage_2:
kcov --bash-method=DEBUG --clean --bash-parse-files-in-dir=. $(KCOVERAGE_DIR)2 $(BATS) test