Debian Codegraph @

Makefile

raw
1 F= files/docker/systemctl.py
2 B= 2016
3 FOR=today
4 DAY=%u
5 # 'make version FOR=yesterday' or 'make version DAY=0'
6
7 version1:
8 @ grep -l __version__ */*.??* */*/*.??* | { while read f; do echo $$f; done; }
9
10 version:
11 @ grep -l __version__ */*.??* */*/*.??* *.py | { while read f; do : \
12 ; Y=`date +%Y -d "$(FOR)"` ; X=$$(expr $$Y - $B) \
13 ; D=`date +%W$(DAY) -d "$(FOR)"` ; sed -i \
14 -e "/^ *__version__/s/[.]-*[0123456789][0123456789][0123456789]*\"/.$$X$$D\"/" \
15 -e "/^ *__version__/s/[.]\\([0123456789]\\)\"/.\\1.$$X$$D\"/" \
16 -e "/^ *__copyright__/s/(C) [0123456789]*-[0123456789]*/(C) $B-$$Y/" \
17 -e "/^ *__copyright__/s/(C) [0123456789]* /(C) $$Y /" \
18 $$f; done; }
19 @ grep ^__version__ files/*/*.??*
20
21 help:
22 python files/docker/systemctl.py help
23 3:
24 cp -v files/docker/systemctl.py files/docker/systemctl3.py
25 sed -i -e "s|/usr/bin/python|/usr/bin/python3|" files/docker/systemctl3.py
26 sed -i -e "s|the.*identical but for|this is just a copy from systemctl.py but for|" files/docker/systemctl3.py
27 diff -U1 files/docker/systemctl.py files/docker/systemctl3.py || true
28 2:
29 cp -v files/docker/systemctl3.py files/docker/systemctl.py
30 sed -i -e "s|/usr/bin/python3|/usr/bin/python|" files/docker/systemctl.py
31 sed -i -e "s|this is just a copy.*|the systemctl*.py files are identical but for the default interpreter|" files/docker/systemctl.py
32 diff -U1 files/docker/systemctl3.py files/docker/systemctl.py || true
33
34 alltests: CH CP UA DJ
35
36 CH centos-httpd.dockerfile: ; ./testsuite.py test_6001
37 CP centos-postgres.dockerfile: ; ./testsuite.py test_6002
38 UA ubuntu-apache2.dockerfile: ; ./testsuite.py test_6005
39 DJ docker-jenkins: ; ./testsuite.py test_900*
40
41 COVERAGE=--coverage
42 est_%: ; rm .coverage* ; ./testsuite.py "t$@" -vv --coverage
43 test_%: ; ./testsuite.py "$@" -vv
44 real_%: ; ./testsuite.py "$@" -vv
45 test: ; $(MAKE) "test_[1234]"
46 st_%: ; $(MAKE) 3 && ./testsuite.py "te$@" -vv $(WITH3)
47
48 WITH3 = --python=/usr/bin/python3 --with=files/docker/systemctl3.py
49 todo/test_%: ; ./testsuite.py "$(notdir $@)" -vv --todo
50 15.2/test_%: ; ./testsuite.py "$(notdir $@)" -vv --image=opensuse/leap:15.2
51 15.1/test_%: ; ./testsuite.py "$(notdir $@)" -vv --image=opensuse/leap:15.1
52 15.0/test_%: ; ./testsuite.py "$(notdir $@)" -vv --image=opensuse/leap:15.0
53 42.3/test_%: ; ./testsuite.py "$(notdir $@)" -vv --image=opensuse:42.3
54 42.2/test_%: ; ./testsuite.py "$(notdir $@)" -vv --image=opensuse:42.2
55 19.10/test_%: ; ./testsuite.py "$(notdir $@)" -vv --image=ubuntu:19.10
56 18.04/test_%: ; ./testsuite.py "$(notdir $@)" -vv --image=ubuntu:18.04
57 16.04/test_%: ; ./testsuite.py "$(notdir $@)" -vv --image=ubuntu:16.04
58 8.1/test_%: ; ./testsuite.py "$(notdir $@)" -vv --image=centos:8.1.1911
59 8.0/test_%: ; ./testsuite.py "$(notdir $@)" -vv --image=centos:8.0.1905
60 7.7/test_%: ; ./testsuite.py "$(notdir $@)" -vv --image=centos:7.7.1908
61 7.6/test_%: ; ./testsuite.py "$(notdir $@)" -vv --image=centos:7.6.1810
62 7.5/test_%: ; ./testsuite.py "$(notdir $@)" -vv --image=centos:7.5.1804
63 7.4/test_%: ; ./testsuite.py "$(notdir $@)" -vv --image=centos:7.4.1708
64 7.3/test_%: ; ./testsuite.py "$(notdir $@)" -vv --image=centos:7.3.1611
65 15.2/st_%: ; $(MAKE) 3 && ./testsuite.py "te$(notdir $@)" -vv --image=opensuse/leap:15.2 $(WITH3)
66 15.1/st_%: ; $(MAKE) 3 && ./testsuite.py "te$(notdir $@)" -vv --image=opensuse/leap:15.1 $(WITH3)
67 15.0/st_%: ; $(MAKE) 3 && ./testsuite.py "te$(notdir $@)" -vv --image=opensuse/leap:15.0 $(WITH3)
68 42.3/st_%: ; $(MAKE) 3 && ./testsuite.py "te$(notdir $@)" -vv --image=opensuse:42.3 $(WITH3)
69 42.2/st_%: ; $(MAKE) 3 && ./testsuite.py "te$(notdir $@)" -vv --image=opensuse:42.2 $(WITH3)
70 18.04/st_%: ; $(MAKE) 3 && ./testsuite.py "te$(notdir $@)" -vv --image=ubuntu:18.04 $(WITH3)
71 16.04/st_%: ; $(MAKE) 3 && ./testsuite.py "te$(notdir $@)" -vv --image=ubuntu:16.04 $(WITH3)
72
73 test3list = st_[567]
74 testslist = test_[567]
75 tests: ; $(MAKE) "test_[1234]"
76 .PHONY: tests
77 15.2/tests: ; $(MAKE) "15.2/$(testslist)"
78 15.1/tests: ; $(MAKE) "15.1/$(testslist)"
79 15.0/tests: ; $(MAKE) "15.0/$(testslist)"
80 42.3/tests: ; $(MAKE) "42.3/$(testslist)"
81 42.2/tests: ; $(MAKE) "42.2/$(testslist)"
82 19.10/tests: ; $(MAKE) "19.10/$(testslist)"
83 18.04/tests: ; $(MAKE) "19.04/$(testslist)"
84 16.04/tests: ; $(MAKE) "16.04/$(testslist)"
85 8.1/tests: ; $(MAKE) "8.1/$(testslist)"
86 8.0/tests: ; $(MAKE) "8.0/$(testslist)"
87 7.7/tests: ; $(MAKE) "7.7/$(testslist)"
88 7.6/tests: ; $(MAKE) "7.6/$(testslist)"
89 7.5/tests: ; $(MAKE) "7.5/$(testslist)"
90 7.4/tests: ; $(MAKE) "7.4/$(testslist)"
91 7.3/tests: ; $(MAKE) "7.3/$(testslist)"
92 15.2/test3: ; $(MAKE) "15.2/$(test3list)"
93 15.1/test3: ; $(MAKE) "15.1/$(test3list)"
94 15.0/test3: ; $(MAKE) "15.0/$(test3list)"
95 42.3/test3: ; $(MAKE) "42.3/$(test3list)"
96 42.2/test3: ; $(MAKE) "42.2/$(test3list)"
97 18.04/test3: ; $(MAKE) "19.04/$(test3list)"
98 16.04/test3: ; $(MAKE) "16.04/$(test3list)"
99
100 nightrun: checkall
101 $(MAKE) checks
102 checkall: checkall2019
103 checkall2018: $(MAKE)
104 $(MAKE) -j1 tests
105 $(MAKE) -j1 7.5/tests 7.4/tests 7.3/tests
106 $(MAKE) -j1 18.04/tests 16.04/tests
107 $(MAKE) -j1 15.0/tests 42.3/tests
108 $(MAKE) -j1 18.04/test3 16.04/test3
109 $(MAKE) -j1 15.0/test3 42.3/test3
110 checkall2019:
111 $(MAKE) -j1 tests
112 $(MAKE) -j1 7.7/tests 7.5/tests 7.4/tests 7.3/tests
113 $(MAKE) -j1 18.04/tests 16.04/tests
114 $(MAKE) -j1 15.1/tests 15.0/tests 42.3/tests
115 $(MAKE) -j1 18.04/test3 16.04/test3
116 $(MAKE) -j1 15.1/test3 15.0/test3 42.3/test3
117
118 check: check2019
119 @ echo please run 'make checks' now
120 19 check2019: ; ./testsuite.py -vv --opensuse=15.1 --centos=7.7 --ubuntu=18.04
121 18 check2018: ; ./testsuite.py -vv --opensuse=15.0 --centos=7.5 --ubuntu=18.04
122 17 check2017: ; ./testsuite.py -vv --opensuse=42.3 --centos=7.4 --ubuntu=16.04
123 16 check2016: ; ./testsuite.py -vv --opensuse=42.2 --centos=7.3 --ubuntu=16.04
124
125 2/test_%:
126 $(MAKE) tmp_systemctl_py_2
127 ./testsuite.py -vv $(notdir $@) --sometime=666 \
128 '--with=tmp/systemctl.py' --python=/usr/bin/python
129 3/test_%:
130 $(MAKE) tmp_systemctl_py_3
131 ./testsuite.py -vv $(notdir $@) --sometime=666 \
132 '--with=tmp/systemctl.py' --python=/usr/bin/python3
133
134 2/est_%:
135 $(MAKE) tmp_systemctl_py_2
136 ./testsuite.py -vv t$(notdir $@) --sometime=666 --coverage \
137 '--with=tmp/systemctl.py' --python=/usr/bin/python
138 3/est_%:
139 $(MAKE) tmp_systemctl_py_3
140 ./testsuite.py -vv t$(notdir $@) --sometime=666 --coverage \
141 '--with=tmp/systemctl.py' --python=/usr/bin/python3
142
143 check2:
144 $(MAKE) tmp_systemctl_py_2
145 ./testsuite.py -vv \
146 '--with=tmp/systemctl.py' --python=/usr/bin/python
147 check3:
148 $(MAKE) tmp_systemctl_py_3
149 ./testsuite.py -vv \
150 '--with=tmp/systemctl.py' --python=/usr/bin/python3
151
152 checks: checks.1 checks.2 checks.3 checks.4
153 checks.1:
154 - rm .coverage*
155 checks.2:
156 $(MAKE) checks2_coverage
157 for i in .coverage*; do mv $$i $$i.cov2; done
158 checks.3:
159 $(MAKE) checks3_coverage
160 for i in .coverage*; do mv $$i $$i.cov3; done
161 checks.4:
162 coverage combine && coverage report && coverage annotate
163 ls -l tmp/systemctl.py,cover
164 @ echo ".... are you ready for 'make checkall' ?"
165
166 checks2:
167 rm .coverage* ; $(MAKE) checks2_coverage
168 checks2_coverage:
169 $(MAKE) tmp_systemctl_py_2
170 ./testsuite.py -vv --coverage \
171 '--with=tmp/systemctl.py'
172 checks3:
173 rm .coverage* ; $(MAKE) checks3_coverage
174 checks3_coverage:
175 $(MAKE) tmp_systemctl_py_3
176 ./testsuite.py -vv --coverage \
177 '--with=tmp/systemctl.py' --python=/usr/bin/python3
178
179 coverage: coverage2
180 coverage2:
181 $(MAKE) tmp_systemctl_py_2
182 rm .coverage* ; ./testsuite.py -vv --coverage test_1 test_2 test_3 test_4 test_6 \
183 '--with=tmp/systemctl.py'
184 coverage3:
185 $(MAKE) tmp_systemctl_py_3
186 rm .coverage* ; ./testsuite.py -vv --coverage test_1 test_2 test_3 test_4 test_6 \
187 '--with=tmp/systemctl.py' --python=/usr/bin/python3
188
189 tmp_systemctl_py_2:
190 @ test -d tmp || mkdir tmp
191 @ cp files/docker/systemctl.py tmp/systemctl.py
192 tmp_systemctl_py_3:
193 @ test -d tmp || mkdir tmp
194 @ cp files/docker/systemctl.py tmp/systemctl.py
195 @ sed -i -e "s|/usr/bin/python|/usr/bin/python3|" tmp/systemctl.py
196
197 clean:
198 - rm .coverage*
199 - rm -rf tmp/tmp.test_*
200 - rm -rf tmp/systemctl.py
201
202 box:
203 docker rm -f $@ ; docker run -d --name $@ --rm=true centos:centos7 sleep 600
204 docker cp files/docker/systemctl.py box:/usr/bin/systemctl
205 docker exec box systemctl daemon-reload -vvv
206 @ echo : docker exec -it box bash