Skip to content

Commit a8839b4

Browse files
masatakeleleliu008
authored andcommitted
buildsys: testing.mak: provide the way to avoid (re)build executables before testing
See #3498 for the needs of this change. Signed-off-by: Masatake YAMATO <[email protected]>
1 parent 3a0444e commit a8839b4

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

makefiles/testing.mak

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ READTAGS_TEST = ./readtags$(EXEEXT)
1616
MINI_GEANY_TEST = ./mini-geany$(EXEEXT)
1717
OPTSCRIPT_TEST = ./optscript$(EXEEXT)
1818

19+
# Make these macros empty from make's command line
20+
# if you don't want to (re)build these executables
21+
# before testing.
22+
# e.g.
23+
#
24+
# $ make units CTAGS_DEP=
25+
#
26+
CTAGS_DEP = $(CTAGS_TEST)
27+
READTAGS_DEP = $(READTAGS_TEST)
28+
MINI_GEANY_DEP = $(MINI_GEANY_TEST)
29+
OPTSCRIPT_DEP = $(OPTSCRIPT_TEST)
30+
1931
if HAVE_TIMEOUT
2032
TIMEOUT = 1
2133
else
@@ -40,7 +52,7 @@ V_RUN_0 = @echo " RUN $@";
4052
#
4153
# SHELL must be dash or bash.
4254
#
43-
fuzz: $(CTAGS_TEST)
55+
fuzz: $(CTAGS_DEP)
4456
$(V_RUN) \
4557
if test -n "$${ZSH_VERSION+set}"; then set -o SH_WORD_SPLIT; fi; \
4658
if test x$(VG) = x1; then \
@@ -56,7 +68,7 @@ fuzz: $(CTAGS_TEST)
5668
#
5769
# NOISE Target
5870
#
59-
noise: $(CTAGS_TEST)
71+
noise: $(CTAGS_DEP)
6072
$(V_RUN) \
6173
if test -n "$${ZSH_VERSION+set}"; then set -o SH_WORD_SPLIT; fi; \
6274
if test x$(VG) = x1; then \
@@ -72,7 +84,7 @@ noise: $(CTAGS_TEST)
7284
#
7385
# CHOP Target
7486
#
75-
chop: $(CTAGS_TEST)
87+
chop: $(CTAGS_DEP)
7688
$(V_RUN) \
7789
if test -n "$${ZSH_VERSION+set}"; then set -o SH_WORD_SPLIT; fi; \
7890
if test x$(VG) = x1; then \
@@ -84,7 +96,7 @@ chop: $(CTAGS_TEST)
8496
$${VALGRIND} --run-shrink \
8597
--with-timeout=$(TIMEOUT)"; \
8698
$(SHELL) $${c} $(srcdir)/Units
87-
slap: $(CTAGS_TEST)
99+
slap: $(CTAGS_DEP)
88100
$(V_RUN) \
89101
if test -n "$${ZSH_VERSION+set}"; then set -o SH_WORD_SPLIT; fi; \
90102
if test x$(VG) = x1; then \
@@ -100,7 +112,7 @@ slap: $(CTAGS_TEST)
100112
#
101113
# UNITS Target
102114
#
103-
units: $(CTAGS_TEST)
115+
units: $(CTAGS_DEP)
104116
$(V_RUN) \
105117
if test -n "$${ZSH_VERSION+set}"; then set -o SH_WORD_SPLIT; fi; \
106118
if test x$(VG) = x1; then \
@@ -161,7 +173,7 @@ validate-input:
161173
#
162174
# Test main part, not parsers
163175
#
164-
tmain: $(CTAGS_TEST) $(READTAGS_TEST) $(OPTSCRIPT_TEST)
176+
tmain: $(CTAGS_DEP) $(READTAGS_DEP) $(OPTSCRIPT_DEP)
165177
$(V_RUN) \
166178
if test -n "$${ZSH_VERSION+set}"; then set -o SH_WORD_SPLIT; fi; \
167179
if test x$(VG) = x1; then \
@@ -204,7 +216,7 @@ clean-tmain:
204216
$(SHELL) $(srcdir)/misc/units clean-tmain $$(pwd)/Tmain; \
205217
fi
206218

207-
tlib: $(MINI_GEANY_TEST)
219+
tlib: $(MINI_GEANY_DEP)
208220
$(V_RUN) \
209221
builddir=$$(pwd); \
210222
mkdir -p $${builddir}/misc; \
@@ -238,7 +250,7 @@ tinst:
238250
# Test readtags
239251
#
240252
if USE_READCMD
241-
roundtrip: $(READTAGS_TEST)
253+
roundtrip: $(READTAGS_DEP)
242254
$(V_RUN) \
243255
if ! test x$(CI) = x; then \
244256
ROUNDTRIP_FLAGS=--minitrip; \
@@ -252,7 +264,7 @@ endif
252264
#
253265
# Checking code in ctags own rules
254266
#
255-
codecheck: $(CTAGS_TEST)
267+
codecheck: $(CTAGS_DEP)
256268
$(V_RUN) $(SHELL) misc/src-check
257269

258270
#
@@ -280,7 +292,7 @@ cppcheck:
280292
#
281293
# Testing examples in per-language man pages
282294
#
283-
man-test: $(CTAGS_TEST)
295+
man-test: $(CTAGS_DEP)
284296
$(V_RUN) \
285297
$(PYTHON) $(srcdir)/misc/man-test.py $(MAN_TEST_TMPDIR) $(CTAGS_TEST) $(srcdir)/man/ctags-lang-*.7.rst.in
286298

0 commit comments

Comments
 (0)