Skip to content

Commit b3b0754

Browse files
committed
Make make docker-test work with various git versions
1 parent f53005f commit b3b0754

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

Makefile

+24-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Make sure we have 'git' and it works OK:
1+
SHELL := bash
2+
3+
# Make sure we have git:
24
ifeq ($(shell which git),)
35
$(error 'git' is not installed on this system)
46
endif
@@ -20,9 +22,16 @@ INSTALL_EXT ?= $(INSTALL_LIB)/$(NAME).d
2022
INSTALL_MAN1 ?= $(DESTDIR)$(PREFIX)/share/man/man1
2123

2224
# Docker variables:
23-
DOCKER_IMAGE := ingy/bash-testing:0.0.1
24-
DOCKER_TESTS := 5.1 5.0 4.4 4.3 4.2 4.1 4.0
25-
DOCKER_TESTS := $(DOCKER_TESTS:%=docker-test-%)
25+
DOCKER_TAG ?= 0.0.3
26+
DOCKER_IMAGE := ingy/bash-testing:$(DOCKER_TAG)
27+
BASH_VERSIONS ?= 5.1 5.0 4.4 4.3 4.2 4.1 4.0
28+
DOCKER_TESTS := $(BASH_VERSIONS:%=docker-test-%)
29+
GIT_VERSIONS := 2.29 2.25 2.17 2.7
30+
31+
prove ?=
32+
test ?= test/
33+
bash ?= 5.0
34+
git ?= 2.29
2635

2736
# Basic targets:
2837
default: help
@@ -37,14 +46,17 @@ help:
3746

3847
.PHONY: test
3948
test:
40-
prove $(PROVEOPT:%=% )test/
49+
prove $(prove) $(test)
50+
51+
test-all: test docker-tests
4152

42-
test-all: test docker-test
53+
docker-test:
54+
$(call docker-make-test,$(bash),$(git))
4355

44-
docker-test: $(DOCKER_TESTS)
56+
docker-tests: $(DOCKER_TESTS)
4557

4658
$(DOCKER_TESTS):
47-
$(call docker-make-test,$(@:docker-test-%=%))
59+
$(call docker-make-test,$(@:docker-test-%=%),$(git))
4860

4961
# Install support:
5062
install:
@@ -101,8 +113,10 @@ define docker-make-test
101113
/bin/bash -c ' \
102114
set -x && \
103115
[[ -d /bash-$(1) ]] && \
104-
export PATH=/bash-$(1)/bin:$$PATH && \
116+
[[ -d /git-$(2) ]] && \
117+
export PATH=/bash-$(1)/bin:/git-$(2)/bin:$$PATH && \
105118
bash --version && \
106-
make test \
119+
git --version && \
120+
make test prove=$(prove) test=$(test) \
107121
'
108122
endef

0 commit comments

Comments
 (0)