]> git.ipfire.org Git - thirdparty/git.git/commitdiff
test helpers: move test-* to t/helper/ subdirectory
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Wed, 13 Apr 2016 13:22:42 +0000 (20:22 +0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 15 Apr 2016 17:12:19 +0000 (10:12 -0700)
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>
39 files changed:
.gitignore
Makefile
t/helper/.gitignore [new file with mode: 0644]
t/helper/test-chmtime.c [moved from test-chmtime.c with 100% similarity]
t/helper/test-config.c [moved from test-config.c with 100% similarity]
t/helper/test-ctype.c [moved from test-ctype.c with 100% similarity]
t/helper/test-date.c [moved from test-date.c with 100% similarity]
t/helper/test-delta.c [moved from test-delta.c with 100% similarity]
t/helper/test-dump-cache-tree.c [moved from test-dump-cache-tree.c with 100% similarity]
t/helper/test-dump-split-index.c [moved from test-dump-split-index.c with 100% similarity]
t/helper/test-dump-untracked-cache.c [moved from test-dump-untracked-cache.c with 100% similarity]
t/helper/test-fake-ssh.c [moved from test-fake-ssh.c with 100% similarity]
t/helper/test-genrandom.c [moved from test-genrandom.c with 100% similarity]
t/helper/test-hashmap.c [moved from test-hashmap.c with 100% similarity]
t/helper/test-index-version.c [moved from test-index-version.c with 100% similarity]
t/helper/test-line-buffer.c [moved from test-line-buffer.c with 100% similarity]
t/helper/test-match-trees.c [moved from test-match-trees.c with 100% similarity]
t/helper/test-mergesort.c [moved from test-mergesort.c with 100% similarity]
t/helper/test-mktemp.c [moved from test-mktemp.c with 100% similarity]
t/helper/test-parse-options.c [moved from test-parse-options.c with 100% similarity]
t/helper/test-path-utils.c [moved from test-path-utils.c with 100% similarity]
t/helper/test-prio-queue.c [moved from test-prio-queue.c with 100% similarity]
t/helper/test-read-cache.c [moved from test-read-cache.c with 100% similarity]
t/helper/test-regex.c [moved from test-regex.c with 100% similarity]
t/helper/test-revision-walking.c [moved from test-revision-walking.c with 100% similarity]
t/helper/test-run-command.c [moved from test-run-command.c with 100% similarity]
t/helper/test-scrap-cache-tree.c [moved from test-scrap-cache-tree.c with 100% similarity]
t/helper/test-sha1-array.c [moved from test-sha1-array.c with 100% similarity]
t/helper/test-sha1.c [moved from test-sha1.c with 100% similarity]
t/helper/test-sha1.sh [moved from test-sha1.sh with 96% similarity]
t/helper/test-sigchain.c [moved from test-sigchain.c with 100% similarity]
t/helper/test-string-list.c [moved from test-string-list.c with 100% similarity]
t/helper/test-submodule-config.c [moved from test-submodule-config.c with 100% similarity]
t/helper/test-subprocess.c [moved from test-subprocess.c with 100% similarity]
t/helper/test-svn-fe.c [moved from test-svn-fe.c with 100% similarity]
t/helper/test-urlmatch-normalization.c [moved from test-urlmatch-normalization.c with 100% similarity]
t/helper/test-wildmatch.c [moved from test-wildmatch.c with 100% similarity]
t/t5601-clone.sh
t/test-lib.sh

index 5087ce1eb7e2210e7fc25a9a14ac3f499ad5ac2f..05cb58a3d4ef47295fa8ef02add44a0f0dd90d1f 100644 (file)
 /gitweb/gitweb.cgi
 /gitweb/static/gitweb.js
 /gitweb/static/gitweb.min.*
-/test-chmtime
-/test-ctype
-/test-config
-/test-date
-/test-delta
-/test-dump-cache-tree
-/test-dump-split-index
-/test-dump-untracked-cache
-/test-fake-ssh
-/test-scrap-cache-tree
-/test-genrandom
-/test-hashmap
-/test-index-version
-/test-line-buffer
-/test-match-trees
-/test-mergesort
-/test-mktemp
-/test-parse-options
-/test-path-utils
-/test-prio-queue
-/test-read-cache
-/test-regex
-/test-revision-walking
-/test-run-command
-/test-sha1
-/test-sha1-array
-/test-sigchain
-/test-string-list
-/test-submodule-config
-/test-subprocess
-/test-svn-fe
-/test-urlmatch-normalization
-/test-wildmatch
 /common-cmds.h
 *.tar.gz
 *.dsc
index 0bed5cb3357c6f13b56267f65b8dae03a767c3ae..69d32bfe31e9cca783480482526ce8b1d88acde1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -624,7 +624,7 @@ TEST_PROGRAMS_NEED_X += test-svn-fe
 TEST_PROGRAMS_NEED_X += test-urlmatch-normalization
 TEST_PROGRAMS_NEED_X += test-wildmatch
 
-TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X))
+TEST_PROGRAMS = $(patsubst %,t/helper/%$X,$(TEST_PROGRAMS_NEED_X))
 
 # List built-in command $C whose implementation cmd_$C() is not in
 # builtin/$C.o but is linked in as part of some other command.
@@ -1904,7 +1904,7 @@ VCSSVN_OBJS += vcs-svn/fast_export.o
 VCSSVN_OBJS += vcs-svn/svndiff.o
 VCSSVN_OBJS += vcs-svn/svndump.o
 
-TEST_OBJS := $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))
+TEST_OBJS := $(patsubst %$X,%.o,$(TEST_PROGRAMS))
 OBJECTS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \
        $(XDIFF_OBJS) \
        $(VCSSVN_OBJS) \
@@ -2211,7 +2211,7 @@ bin-wrappers/%: wrap-for-bin.sh
        @mkdir -p bin-wrappers
        $(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
             -e 's|@@BUILD_DIR@@|$(shell pwd)|' \
-            -e 's|@@PROG@@|$(@F)|' < $< > $@ && \
+            -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))|' < $< > $@ && \
        chmod +x $@
 
 # GNU make supports exporting all variables by "export" without parameters.
@@ -2231,25 +2231,25 @@ perf: all
 
 .PHONY: test perf
 
-test-ctype$X: ctype.o
+t/helper/test-ctype$X: ctype.o
 
-test-date$X: date.o ctype.o
+t/helper/test-date$X: date.o ctype.o
 
-test-delta$X: diff-delta.o patch-delta.o
+t/helper/test-delta$X: diff-delta.o patch-delta.o
 
-test-line-buffer$X: vcs-svn/lib.a
+t/helper/test-line-buffer$X: vcs-svn/lib.a
 
-test-parse-options$X: parse-options.o parse-options-cb.o
+t/helper/test-parse-options$X: parse-options.o parse-options-cb.o
 
-test-svn-fe$X: vcs-svn/lib.a
+t/helper/test-svn-fe$X: vcs-svn/lib.a
 
 .PRECIOUS: $(TEST_OBJS)
 
-test-%$X: test-%.o GIT-LDFLAGS $(GITLIBS)
+t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS)
        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)
 
-check-sha1:: test-sha1$X
-       ./test-sha1.sh
+check-sha1:: t/helper/test-sha1$X
+       t/helper/test-sha1.sh
 
 SP_OBJ = $(patsubst %.o,%.sp,$(C_OBJ))
 
diff --git a/t/helper/.gitignore b/t/helper/.gitignore
new file mode 100644 (file)
index 0000000..d6e8b36
--- /dev/null
@@ -0,0 +1,33 @@
+/test-chmtime
+/test-ctype
+/test-config
+/test-date
+/test-delta
+/test-dump-cache-tree
+/test-dump-split-index
+/test-dump-untracked-cache
+/test-fake-ssh
+/test-scrap-cache-tree
+/test-genrandom
+/test-hashmap
+/test-index-version
+/test-line-buffer
+/test-match-trees
+/test-mergesort
+/test-mktemp
+/test-parse-options
+/test-path-utils
+/test-prio-queue
+/test-read-cache
+/test-regex
+/test-revision-walking
+/test-run-command
+/test-sha1
+/test-sha1-array
+/test-sigchain
+/test-string-list
+/test-submodule-config
+/test-subprocess
+/test-svn-fe
+/test-urlmatch-normalization
+/test-wildmatch
similarity index 100%
rename from test-chmtime.c
rename to t/helper/test-chmtime.c
similarity index 100%
rename from test-config.c
rename to t/helper/test-config.c
similarity index 100%
rename from test-ctype.c
rename to t/helper/test-ctype.c
similarity index 100%
rename from test-date.c
rename to t/helper/test-date.c
similarity index 100%
rename from test-delta.c
rename to t/helper/test-delta.c
similarity index 100%
rename from test-fake-ssh.c
rename to t/helper/test-fake-ssh.c
similarity index 100%
rename from test-genrandom.c
rename to t/helper/test-genrandom.c
similarity index 100%
rename from test-hashmap.c
rename to t/helper/test-hashmap.c
similarity index 100%
rename from test-mergesort.c
rename to t/helper/test-mergesort.c
similarity index 100%
rename from test-mktemp.c
rename to t/helper/test-mktemp.c
similarity index 100%
rename from test-path-utils.c
rename to t/helper/test-path-utils.c
similarity index 100%
rename from test-prio-queue.c
rename to t/helper/test-prio-queue.c
similarity index 100%
rename from test-read-cache.c
rename to t/helper/test-read-cache.c
similarity index 100%
rename from test-regex.c
rename to t/helper/test-regex.c
similarity index 100%
rename from test-sha1-array.c
rename to t/helper/test-sha1-array.c
similarity index 100%
rename from test-sha1.c
rename to t/helper/test-sha1.c
similarity index 96%
rename from test-sha1.sh
rename to t/helper/test-sha1.sh
index cef4bcc8664a1023de074d1355c358450dc4057e..750b95a0a1c39b4d761b7f2f861f6df4c85ecb65 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 dd if=/dev/zero bs=1048576 count=100 2>/dev/null |
-/usr/bin/time ./test-sha1 >/dev/null
+/usr/bin/time t/helper/test-sha1 >/dev/null
 
 while read expect cnt pfx
 do
@@ -11,7 +11,7 @@ do
                        test -z "$pfx" || echo "$pfx"
                        dd if=/dev/zero bs=1048576 count=$cnt 2>/dev/null |
                        perl -pe 'y/\000/g/'
-               } | ./test-sha1 $cnt
+               } | ./t/helper/test-sha1 $cnt
        )
        if test "$expect" = "$actual"
        then
similarity index 100%
rename from test-sigchain.c
rename to t/helper/test-sigchain.c
similarity index 100%
rename from test-subprocess.c
rename to t/helper/test-subprocess.c
similarity index 100%
rename from test-svn-fe.c
rename to t/helper/test-svn-fe.c
similarity index 100%
rename from test-wildmatch.c
rename to t/helper/test-wildmatch.c
index c1efb8e445402cccdddda987e1eafad4d4bb75f9..150aeaf7137b6521874322fd9e966d4061d71044 100755 (executable)
@@ -308,7 +308,7 @@ test_expect_success 'clone checking out a tag' '
 
 setup_ssh_wrapper () {
        test_expect_success 'setup ssh wrapper' '
-               cp "$GIT_BUILD_DIR/test-fake-ssh$X" \
+               cp "$GIT_BUILD_DIR/t/helper/test-fake-ssh$X" \
                        "$TRASH_DIRECTORY/ssh-wrapper$X" &&
                GIT_SSH="$TRASH_DIRECTORY/ssh-wrapper$X" &&
                export GIT_SSH &&
index 0b47eb6bb299492d31111c94557c216bb3f32c7f..cd0ecd444de0cb38bdcfda159f1e8c18b7fdce03 100644 (file)
@@ -854,10 +854,10 @@ test -d "$GIT_BUILD_DIR"/templates/blt || {
        error "You haven't built things yet, have you?"
 }
 
-if ! test -x "$GIT_BUILD_DIR"/test-chmtime
+if ! test -x "$GIT_BUILD_DIR"/t/helper/test-chmtime
 then
        echo >&2 'You need to build test-chmtime:'
-       echo >&2 'Run "make test-chmtime" in the source (toplevel) directory'
+       echo >&2 'Run "make t/helper/test-chmtime" in the source (toplevel) directory'
        exit 1
 fi