Skip to content

Commit e0b5851

Browse files
committed
Merge branch 'nd/test-helpers'
Sources to many test helper binaries (and the generated helpers) have been moved to t/helper/ subdirectory to reduce clutter at the top level of the tree. * nd/test-helpers: test helpers: move test-* to t/helper/ subdirectory Makefile: clean *.o files we create
2 parents e7e6826 + e6e7530 commit e0b5851

39 files changed

+52
-52
lines changed

.gitignore

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -179,39 +179,6 @@
179179
/gitweb/gitweb.cgi
180180
/gitweb/static/gitweb.js
181181
/gitweb/static/gitweb.min.*
182-
/test-chmtime
183-
/test-ctype
184-
/test-config
185-
/test-date
186-
/test-delta
187-
/test-dump-cache-tree
188-
/test-dump-split-index
189-
/test-dump-untracked-cache
190-
/test-fake-ssh
191-
/test-scrap-cache-tree
192-
/test-genrandom
193-
/test-hashmap
194-
/test-index-version
195-
/test-line-buffer
196-
/test-match-trees
197-
/test-mergesort
198-
/test-mktemp
199-
/test-parse-options
200-
/test-path-utils
201-
/test-prio-queue
202-
/test-read-cache
203-
/test-regex
204-
/test-revision-walking
205-
/test-run-command
206-
/test-sha1
207-
/test-sha1-array
208-
/test-sigchain
209-
/test-string-list
210-
/test-submodule-config
211-
/test-subprocess
212-
/test-svn-fe
213-
/test-urlmatch-normalization
214-
/test-wildmatch
215182
/common-cmds.h
216183
*.tar.gz
217184
*.dsc

Makefile

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ TEST_PROGRAMS_NEED_X += test-svn-fe
621621
TEST_PROGRAMS_NEED_X += test-urlmatch-normalization
622622
TEST_PROGRAMS_NEED_X += test-wildmatch
623623

624-
TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X))
624+
TEST_PROGRAMS = $(patsubst %,t/helper/%$X,$(TEST_PROGRAMS_NEED_X))
625625

626626
# List built-in command $C whose implementation cmd_$C() is not in
627627
# builtin/$C.o but is linked in as part of some other command.
@@ -1898,7 +1898,7 @@ VCSSVN_OBJS += vcs-svn/fast_export.o
18981898
VCSSVN_OBJS += vcs-svn/svndiff.o
18991899
VCSSVN_OBJS += vcs-svn/svndump.o
19001900

1901-
TEST_OBJS := $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))
1901+
TEST_OBJS := $(patsubst %$X,%.o,$(TEST_PROGRAMS))
19021902
OBJECTS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \
19031903
$(XDIFF_OBJS) \
19041904
$(VCSSVN_OBJS) \
@@ -2205,7 +2205,7 @@ bin-wrappers/%: wrap-for-bin.sh
22052205
@mkdir -p bin-wrappers
22062206
$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
22072207
-e 's|@@BUILD_DIR@@|$(shell pwd)|' \
2208-
-e 's|@@PROG@@|$(@F)|' < $< > $@ && \
2208+
-e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))|' < $< > $@ && \
22092209
chmod +x $@
22102210

22112211
# GNU make supports exporting all variables by "export" without parameters.
@@ -2225,25 +2225,25 @@ perf: all
22252225

22262226
.PHONY: test perf
22272227

2228-
test-ctype$X: ctype.o
2228+
t/helper/test-ctype$X: ctype.o
22292229

2230-
test-date$X: date.o ctype.o
2230+
t/helper/test-date$X: date.o ctype.o
22312231

2232-
test-delta$X: diff-delta.o patch-delta.o
2232+
t/helper/test-delta$X: diff-delta.o patch-delta.o
22332233

2234-
test-line-buffer$X: vcs-svn/lib.a
2234+
t/helper/test-line-buffer$X: vcs-svn/lib.a
22352235

2236-
test-parse-options$X: parse-options.o parse-options-cb.o
2236+
t/helper/test-parse-options$X: parse-options.o parse-options-cb.o
22372237

2238-
test-svn-fe$X: vcs-svn/lib.a
2238+
t/helper/test-svn-fe$X: vcs-svn/lib.a
22392239

22402240
.PRECIOUS: $(TEST_OBJS)
22412241

2242-
test-%$X: test-%.o GIT-LDFLAGS $(GITLIBS)
2242+
t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS)
22432243
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)
22442244

2245-
check-sha1:: test-sha1$X
2246-
./test-sha1.sh
2245+
check-sha1:: t/helper/test-sha1$X
2246+
t/helper/test-sha1.sh
22472247

22482248
SP_OBJ = $(patsubst %.o,%.sp,$(C_OBJ))
22492249

@@ -2450,8 +2450,8 @@ profile-clean:
24502450
$(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
24512451

24522452
clean: profile-clean coverage-clean
2453-
$(RM) *.o *.res refs/*.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o
2454-
$(RM) xdiff/*.o vcs-svn/*.o ewah/*.o builtin/*.o
2453+
$(RM) *.res
2454+
$(RM) $(OBJECTS)
24552455
$(RM) $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB)
24562456
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X
24572457
$(RM) $(TEST_PROGRAMS) $(NO_INSTALL)

t/helper/.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/test-chmtime
2+
/test-ctype
3+
/test-config
4+
/test-date
5+
/test-delta
6+
/test-dump-cache-tree
7+
/test-dump-split-index
8+
/test-dump-untracked-cache
9+
/test-fake-ssh
10+
/test-scrap-cache-tree
11+
/test-genrandom
12+
/test-hashmap
13+
/test-index-version
14+
/test-line-buffer
15+
/test-match-trees
16+
/test-mergesort
17+
/test-mktemp
18+
/test-parse-options
19+
/test-path-utils
20+
/test-prio-queue
21+
/test-read-cache
22+
/test-regex
23+
/test-revision-walking
24+
/test-run-command
25+
/test-sha1
26+
/test-sha1-array
27+
/test-sigchain
28+
/test-string-list
29+
/test-submodule-config
30+
/test-subprocess
31+
/test-svn-fe
32+
/test-urlmatch-normalization
33+
/test-wildmatch
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)