test helpers: move test-* to t/helper/ subdirectory
This keeps top dir a bit less crowded. And because these programs are for testing purposes, it makes sense that they stay somewhere in t/ Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy committed
Apr 13, 2016 at 20:22 UTC
e6e7530d10b74d763b4311ea93e0a831b810d6c2
39 files changed
+50
-50
.gitignore
-33
@@ -179,39 +179,6 @@
179
/gitweb/gitweb.cgi
180
/gitweb/static/gitweb.js
181
/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
182
/common-cmds.h
183
*.tar.gz
184
*.dsc
Makefile
+12
-12
@@ -624,7 +624,7 @@ TEST_PROGRAMS_NEED_X += test-svn-fe
624
TEST_PROGRAMS_NEED_X += test-urlmatch-normalization
625
TEST_PROGRAMS_NEED_X += test-wildmatch
626
627
-TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X))
627
+TEST_PROGRAMS = $(patsubst %,t/helper/%$X,$(TEST_PROGRAMS_NEED_X))
628
629
# List built-in command $C whose implementation cmd_$C() is not in
630
# builtin/$C.o but is linked in as part of some other command.
@@ -1904,7 +1904,7 @@ VCSSVN_OBJS += vcs-svn/fast_export.o
1904
VCSSVN_OBJS += vcs-svn/svndiff.o
1905
VCSSVN_OBJS += vcs-svn/svndump.o
1906
1907
-TEST_OBJS := $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))
1907
+TEST_OBJS := $(patsubst %$X,%.o,$(TEST_PROGRAMS))
1908
OBJECTS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \
1909
$(XDIFF_OBJS) \
1910
$(VCSSVN_OBJS) \
@@ -2211,7 +2211,7 @@ bin-wrappers/%: wrap-for-bin.sh
2211
@mkdir -p bin-wrappers
2212
$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
2213
-e 's|@@BUILD_DIR@@|$(shell pwd)|' \
2214
- -e 's|@@PROG@@|$(@F)|' < $< > $@ && \
2214
+ -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))|' < $< > $@ && \
2215
chmod +x $@
2216
2217
# GNU make supports exporting all variables by "export" without parameters.
@@ -2231,25 +2231,25 @@ perf: all
2231
2232
.PHONY: test perf
2233
2234
-test-ctype$X: ctype.o
2234
+t/helper/test-ctype$X: ctype.o
2235
2236
-test-date$X: date.o ctype.o
2236
+t/helper/test-date$X: date.o ctype.o
2237
2238
-test-delta$X: diff-delta.o patch-delta.o
2238
+t/helper/test-delta$X: diff-delta.o patch-delta.o
2239
2240
-test-line-buffer$X: vcs-svn/lib.a
2240
+t/helper/test-line-buffer$X: vcs-svn/lib.a
2241
2242
-test-parse-options$X: parse-options.o parse-options-cb.o
2242
+t/helper/test-parse-options$X: parse-options.o parse-options-cb.o
2243
2244
-test-svn-fe$X: vcs-svn/lib.a
2244
+t/helper/test-svn-fe$X: vcs-svn/lib.a
2245
2246
.PRECIOUS: $(TEST_OBJS)
2247
2248
-test-%$X: test-%.o GIT-LDFLAGS $(GITLIBS)
2248
+t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS)
2249
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)
2250
2251
-check-sha1:: test-sha1$X
2252
- ./test-sha1.sh
2251
+check-sha1:: t/helper/test-sha1$X
2252
+ t/helper/test-sha1.sh
2253
2254
SP_OBJ = $(patsubst %.o,%.sp,$(C_OBJ))
2255
t/helper/.gitignore
new
+33
@@ -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
t/helper/test-chmtime.c
renamed
t/helper/test-config.c
renamed
t/helper/test-ctype.c
renamed
t/helper/test-date.c
renamed
t/helper/test-delta.c
renamed
t/helper/test-dump-cache-tree.c
renamed
t/helper/test-dump-split-index.c
renamed
t/helper/test-dump-untracked-cache.c
renamed
t/helper/test-fake-ssh.c
renamed
t/helper/test-genrandom.c
renamed
t/helper/test-hashmap.c
renamed
t/helper/test-index-version.c
renamed
t/helper/test-line-buffer.c
renamed
t/helper/test-match-trees.c
renamed
t/helper/test-mergesort.c
renamed
t/helper/test-mktemp.c
renamed
t/helper/test-parse-options.c
renamed
t/helper/test-path-utils.c
renamed
t/helper/test-prio-queue.c
renamed
t/helper/test-read-cache.c
renamed
t/helper/test-regex.c
renamed
t/helper/test-revision-walking.c
renamed
t/helper/test-run-command.c
renamed
t/helper/test-scrap-cache-tree.c
renamed
t/helper/test-sha1-array.c
renamed
t/helper/test-sha1.c
renamed
t/helper/test-sha1.sh
renamed
+2
-2
@@ -1,7 +1,7 @@
1
#!/bin/sh
2
3
dd if=/dev/zero bs=1048576 count=100 2>/dev/null |
4
-/usr/bin/time ./test-sha1 >/dev/null
4
+/usr/bin/time t/helper/test-sha1 >/dev/null
5
6
while read expect cnt pfx
7
do
@@ -11,7 +11,7 @@ do
11
test -z "$pfx" || echo "$pfx"
12
dd if=/dev/zero bs=1048576 count=$cnt 2>/dev/null |
13
perl -pe 'y/\000/g/'
14
- } | ./test-sha1 $cnt
14
+ } | ./t/helper/test-sha1 $cnt
15
)
16
if test "$expect" = "$actual"
17
then
t/helper/test-sigchain.c
renamed
t/helper/test-string-list.c
renamed
t/helper/test-submodule-config.c
renamed
t/helper/test-subprocess.c
renamed
t/helper/test-svn-fe.c
renamed
t/helper/test-urlmatch-normalization.c
renamed
t/helper/test-wildmatch.c
renamed
t/t5601-clone.sh
+1
-1
@@ -308,7 +308,7 @@ test_expect_success 'clone checking out a tag' '
308
309
setup_ssh_wrapper () {
310
test_expect_success 'setup ssh wrapper' '
311
- cp "$GIT_BUILD_DIR/test-fake-ssh$X" \
311
+ cp "$GIT_BUILD_DIR/t/helper/test-fake-ssh$X" \
312
"$TRASH_DIRECTORY/ssh-wrapper$X" &&
313
GIT_SSH="$TRASH_DIRECTORY/ssh-wrapper$X" &&
314
export GIT_SSH &&
t/test-lib.sh
+2
-2
@@ -854,10 +854,10 @@ test -d "$GIT_BUILD_DIR"/templates/blt || {
854
error "You haven't built things yet, have you?"
855
}
856
857
-if ! test -x "$GIT_BUILD_DIR"/test-chmtime
857
+if ! test -x "$GIT_BUILD_DIR"/t/helper/test-chmtime
858
then
859
echo >&2 'You need to build test-chmtime:'
860
- echo >&2 'Run "make test-chmtime" in the source (toplevel) directory'
860
+ echo >&2 'Run "make t/helper/test-chmtime" in the source (toplevel) directory'
861
exit 1
862
fi
863