Skip to content

Commit c89e694

Browse files
Gerhard Lazugerhard
Gerhard Lazu
authored andcommitted
Add target to run bats tests to Makefile
The `bats` target will clone and install the bats command in a manner similar to `kerl` or `hex.pm`, i.e. to ERLANG_MK_TMP [#150452491] Signed-off-by: Luke Bakken <[email protected]>
1 parent 42b8137 commit c89e694

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,24 @@ ERLANG_MK_COMMIT = rabbitmq-tmp
149149
include rabbitmq-components.mk
150150
include erlang.mk
151151

152+
ifeq ($(strip $(BATS)),)
153+
BATS := $(ERLANG_MK_TMP)/bats/bin/bats
154+
endif
155+
156+
BATS_GIT ?= https://github.com/sstephenson/bats
157+
BATS_COMMIT ?= v0.4.0
158+
159+
$(BATS):
160+
$(verbose) mkdir -p $(ERLANG_MK_TMP)
161+
$(gen_verbose) git clone --depth 1 --branch=$(BATS_COMMIT) $(BATS_GIT) $(ERLANG_MK_TMP)/bats
162+
163+
.PHONY: bats
164+
165+
bats: $(BATS)
166+
$(verbose) $(BATS) $(TEST_DIR)
167+
168+
tests:: bats
169+
152170
SLOW_CT_SUITES := backing_queue \
153171
cluster_rename \
154172
clustering_management \

0 commit comments

Comments
 (0)