1
- # Make sure we have 'git' and it works OK:
1
+ SHELL := bash
2
+
3
+ # Make sure we have git:
2
4
ifeq ($(shell which git) ,)
3
5
$(error 'git' is not installed on this system)
4
6
endif
@@ -20,9 +22,16 @@ INSTALL_EXT ?= $(INSTALL_LIB)/$(NAME).d
20
22
INSTALL_MAN1 ?= $(DESTDIR )$(PREFIX ) /share/man/man1
21
23
22
24
# 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
26
35
27
36
# Basic targets:
28
37
default : help
@@ -37,14 +46,17 @@ help:
37
46
38
47
.PHONY : test
39
48
test :
40
- prove $(PROVEOPT:%=% ) test/
49
+ prove $(prove ) $(test )
50
+
51
+ test-all : test docker-tests
41
52
42
- test-all : test docker-test
53
+ docker-test :
54
+ $(call docker-make-test,$(bash ) ,$(git ) )
43
55
44
- docker-test : $(DOCKER_TESTS )
56
+ docker-tests : $(DOCKER_TESTS )
45
57
46
58
$(DOCKER_TESTS ) :
47
- $(call docker-make-test,$(@:docker-test-%=% ) )
59
+ $(call docker-make-test,$(@:docker-test-%=% ) , $( git ) )
48
60
49
61
# Install support:
50
62
install :
@@ -101,8 +113,10 @@ define docker-make-test
101
113
/bin/bash -c ' \
102
114
set -x && \
103
115
[[ -d /bash-$(1 ) ]] && \
104
- export PATH=/bash-$(1 ) /bin:$$PATH && \
116
+ [[ -d /git-$(2 ) ]] && \
117
+ export PATH=/bash-$(1 ) /bin:/git-$(2 ) /bin:$$PATH && \
105
118
bash --version && \
106
- make test \
119
+ git --version && \
120
+ make test prove=$(prove ) test=$(test ) \
107
121
'
108
122
endef
0 commit comments