git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH/RFC] Move test-*.c to test/ subdirectory

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Feb 9, 2011, 15:14 UTC
Message-ID
<1297264469-13675-1-git-send-email-pclouds@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 This makes topdir 19 files less and does not seem to break tests.
 There's only one new test(-mktemp) on pu.
 .gitignore                                       |   19 ------
 Makefile                                         |   71 +++++++++++-----------
 t/test-lib.sh                                    |    6 +-
 test/.gitignore                                  |   19 ++++++
 test-chmtime.c => test/chmtime.c                 |    0
 test-ctype.c => test/ctype.c                     |    0
 test-date.c => test/date.c                       |    0
 test-delta.c => test/delta.c                     |    0
 test-dump-cache-tree.c => test/dump-cache-tree.c |    0
 test-genrandom.c => test/genrandom.c             |    0
 test-index-version.c => test/index-version.c     |    0
 test-line-buffer.c => test/line-buffer.c         |    0
 test-match-trees.c => test/match-trees.c         |    0
 test-obj-pool.c => test/obj-pool.c               |    0
 test-parse-options.c => test/parse-options.c     |    0
 test-path-utils.c => test/path-utils.c           |    0
 test-run-command.c => test/run-command.c         |    0
 test-sha1.c => test/sha1.c                       |    0
 test-sigchain.c => test/sigchain.c               |    0
 test-string-pool.c => test/string-pool.c         |    0
 test-subprocess.c => test/subprocess.c           |    0
 test-svn-fe.c => test/svn-fe.c                   |    0
 test-treap.c => test/treap.c                     |    0
 23 files changed, 58 insertions(+), 57 deletions(-)
 create mode 100644 test/.gitignore
 rename test-chmtime.c => test/chmtime.c (100%)
 rename test-ctype.c => test/ctype.c (100%)
 rename test-date.c => test/date.c (100%)
 rename test-delta.c => test/delta.c (100%)
 rename test-dump-cache-tree.c => test/dump-cache-tree.c (100%)
 rename test-genrandom.c => test/genrandom.c (100%)
 rename test-index-version.c => test/index-version.c (100%)
 rename test-line-buffer.c => test/line-buffer.c (100%)
 rename test-match-trees.c => test/match-trees.c (100%)
 rename test-obj-pool.c => test/obj-pool.c (100%)
 rename test-parse-options.c => test/parse-options.c (100%)
 rename test-path-utils.c => test/path-utils.c (100%)
 rename test-run-command.c => test/run-command.c (100%)
 rename test-sha1.c => test/sha1.c (100%)
 rename test-sigchain.c => test/sigchain.c (100%)
 rename test-string-pool.c => test/string-pool.c (100%)
 rename test-subprocess.c => test/subprocess.c (100%)
 rename test-svn-fe.c => test/svn-fe.c (100%)
 rename test-treap.c => test/treap.c (100%)
diff --git a/.gitignore b/.gitignore
index 3dd6ef7..a99a216 100644
--- a/.gitignore
+++ b/.gitignore
@@ -161,25 +161,6 @@
 /gitweb/GITWEB-BUILD-OPTIONS
 /gitweb/gitweb.cgi
 /gitweb/static/gitweb.min.*
-/test-chmtime
-/test-ctype
-/test-date
-/test-delta
-/test-dump-cache-tree
-/test-genrandom
-/test-index-version
-/test-line-buffer
-/test-match-trees
-/test-obj-pool
-/test-parse-options
-/test-path-utils
-/test-run-command
-/test-sha1
-/test-sigchain
-/test-string-pool
-/test-subprocess
-/test-svn-fe
-/test-treap
 /common-cmds.h
 *.tar.gz
 *.dsc
diff --git a/Makefile b/Makefile
index 775ee83..617f910 100644
--- a/Makefile
+++ b/Makefile
@@ -416,25 +416,25 @@ PROGRAM_OBJS += http-backend.o
 
 PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))
 
-TEST_PROGRAMS_NEED_X += test-chmtime
-TEST_PROGRAMS_NEED_X += test-ctype
-TEST_PROGRAMS_NEED_X += test-date
-TEST_PROGRAMS_NEED_X += test-delta
-TEST_PROGRAMS_NEED_X += test-dump-cache-tree
-TEST_PROGRAMS_NEED_X += test-genrandom
-TEST_PROGRAMS_NEED_X += test-line-buffer
-TEST_PROGRAMS_NEED_X += test-match-trees
-TEST_PROGRAMS_NEED_X += test-obj-pool
-TEST_PROGRAMS_NEED_X += test-parse-options
-TEST_PROGRAMS_NEED_X += test-path-utils
-TEST_PROGRAMS_NEED_X += test-run-command
-TEST_PROGRAMS_NEED_X += test-sha1
-TEST_PROGRAMS_NEED_X += test-sigchain
-TEST_PROGRAMS_NEED_X += test-string-pool
-TEST_PROGRAMS_NEED_X += test-subprocess
-TEST_PROGRAMS_NEED_X += test-svn-fe
-TEST_PROGRAMS_NEED_X += test-treap
-TEST_PROGRAMS_NEED_X += test-index-version
+TEST_PROGRAMS_NEED_X += test/chmtime
+TEST_PROGRAMS_NEED_X += test/ctype
+TEST_PROGRAMS_NEED_X += test/date
+TEST_PROGRAMS_NEED_X += test/delta
+TEST_PROGRAMS_NEED_X += test/dump-cache-tree
+TEST_PROGRAMS_NEED_X += test/genrandom
+TEST_PROGRAMS_NEED_X += test/line-buffer
+TEST_PROGRAMS_NEED_X += test/match-trees
+TEST_PROGRAMS_NEED_X += test/obj-pool
+TEST_PROGRAMS_NEED_X += test/parse-options
+TEST_PROGRAMS_NEED_X += test/path-utils
+TEST_PROGRAMS_NEED_X += test/run-command
+TEST_PROGRAMS_NEED_X += test/sha1
+TEST_PROGRAMS_NEED_X += test/sigchain
+TEST_PROGRAMS_NEED_X += test/string-pool
+TEST_PROGRAMS_NEED_X += test/subprocess
+TEST_PROGRAMS_NEED_X += test/svn-fe
+TEST_PROGRAMS_NEED_X += test/treap
+TEST_PROGRAMS_NEED_X += test/index-version
 
 TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X))
 
@@ -1829,7 +1829,7 @@ git.o git.spec \
 	$(patsubst %.perl,%,$(SCRIPT_PERL)) \
 	: GIT-VERSION-FILE
 
-TEST_OBJS := $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))
+TEST_OBJS := $(patsubst test/%$X,test/%.o,$(TEST_PROGRAMS))
 GIT_OBJS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \
 	git.o
 ifndef NO_CURL
@@ -1839,8 +1839,8 @@ XDIFF_OBJS = xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \
 	xdiff/xmerge.o xdiff/xpatience.o
 VCSSVN_OBJS = vcs-svn/string_pool.o vcs-svn/line_buffer.o \
 	vcs-svn/repo_tree.o vcs-svn/fast_export.o vcs-svn/svndump.o
-VCSSVN_TEST_OBJS = test-obj-pool.o test-string-pool.o \
-	test-line-buffer.o test-treap.o
+VCSSVN_TEST_OBJS = test/obj-pool.o test/string-pool.o \
+	test/line-buffer.o test/treap.o
 OBJECTS := $(GIT_OBJS) $(XDIFF_OBJS) $(VCSSVN_OBJS)
 
 dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d)
@@ -1968,7 +1968,7 @@ $(VCSSVN_OBJS) $(VCSSVN_TEST_OBJS): $(LIB_H) \
 	vcs-svn/line_buffer.h vcs-svn/repo_tree.h vcs-svn/fast_export.h \
 	vcs-svn/svndump.h
 
-test-svn-fe.o: vcs-svn/svndump.h
+test/svn-fe.o: vcs-svn/svndump.h
 endif
 
 exec_cmd.s exec_cmd.o: EXTRA_CPPFLAGS = \
@@ -2100,7 +2100,8 @@ GIT-GUI-VARS: FORCE
             fi
 endif
 
-test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(BINDIR_PROGRAMS_NO_X) $(TEST_PROGRAMS_NEED_X))
+test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(BINDIR_PROGRAMS_NO_X))
+test_bindir_programs += $(patsubst test/%,bin-wrappers/test-%,$(TEST_PROGRAMS_NEED_X))
 
 all:: $(TEST_PROGRAMS) $(test_bindir_programs)
 
@@ -2108,7 +2109,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-%,test/%,$(@F))|' < $< > $@ && \
 	chmod +x $@
 
 # GNU make supports exporting all variables by "export" without parameters.
@@ -2122,27 +2123,27 @@ export NO_SVN_TESTS
 test: all
 	$(MAKE) -C t/ all
 
-test-ctype$X: ctype.o
+test/ctype$X: ctype.o
 
-test-date$X: date.o ctype.o
+test/date$X: date.o ctype.o
 
-test-delta$X: diff-delta.o patch-delta.o
+test/delta$X: diff-delta.o patch-delta.o
 
-test-line-buffer$X: vcs-svn/lib.a
+test/line-buffer$X: vcs-svn/lib.a
 
-test-parse-options$X: parse-options.o
+test/parse-options$X: parse-options.o
 
-test-string-pool$X: vcs-svn/lib.a
+test/string-pool$X: vcs-svn/lib.a
 
-test-svn-fe$X: vcs-svn/lib.a
+test/svn-fe$X: vcs-svn/lib.a
 
 .PRECIOUS: $(TEST_OBJS)
 
-test-%$X: test-%.o $(GITLIBS)
+test/%$X: test/%.o $(GITLIBS)
 	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)
 
-check-sha1:: test-sha1$X
-	./test-sha1.sh
+check-sha1:: test/sha1$X
+	./test/sha1.sh
 
 check: common-cmds.h
 	if sparse; \
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 0fdc541..240caec 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -984,9 +984,9 @@ then
 	}
 fi
 
-if ! test -x "$GIT_BUILD_DIR"/test-chmtime; then
-	echo >&2 'You need to build test-chmtime:'
-	echo >&2 'Run "make test-chmtime" in the source (toplevel) directory'
+if ! test -x "$GIT_BUILD_DIR"/test/chmtime; then
+	echo >&2 'You need to build test/chmtime:'
+	echo >&2 'Run "make test/chmtime" in the source (toplevel) directory'
 	exit 1
 fi
 
diff --git a/test/.gitignore b/test/.gitignore
new file mode 100644
index 0000000..6e8a2a1
--- /dev/null
+++ b/test/.gitignore
@@ -0,0 +1,19 @@
+/chmtime
+/ctype
+/date
+/delta
+/dump-cache-tree
+/genrandom
+/index-version
+/line-buffer
+/match-trees
+/obj-pool
+/parse-options
+/path-utils
+/run-command
+/sha1
+/sigchain
+/string-pool
+/subprocess
+/svn-fe
+/treap
diff --git a/test-chmtime.c b/test/chmtime.c
similarity index 100%
rename from test-chmtime.c
rename to test/chmtime.c
diff --git a/test-ctype.c b/test/ctype.c
similarity index 100%
rename from test-ctype.c
rename to test/ctype.c
diff --git a/test-date.c b/test/date.c
similarity index 100%
rename from test-date.c
rename to test/date.c
diff --git a/test-delta.c b/test/delta.c
similarity index 100%
rename from test-delta.c
rename to test/delta.c
diff --git a/test-dump-cache-tree.c b/test/dump-cache-tree.c
similarity index 100%
rename from test-dump-cache-tree.c
rename to test/dump-cache-tree.c
diff --git a/test-genrandom.c b/test/genrandom.c
similarity index 100%
rename from test-genrandom.c
rename to test/genrandom.c
diff --git a/test-index-version.c b/test/index-version.c
similarity index 100%
rename from test-index-version.c
rename to test/index-version.c
diff --git a/test-line-buffer.c b/test/line-buffer.c
similarity index 100%
rename from test-line-buffer.c
rename to test/line-buffer.c
diff --git a/test-match-trees.c b/test/match-trees.c
similarity index 100%
rename from test-match-trees.c
rename to test/match-trees.c
diff --git a/test-obj-pool.c b/test/obj-pool.c
similarity index 100%
rename from test-obj-pool.c
rename to test/obj-pool.c
diff --git a/test-parse-options.c b/test/parse-options.c
similarity index 100%
rename from test-parse-options.c
rename to test/parse-options.c
diff --git a/test-path-utils.c b/test/path-utils.c
similarity index 100%
rename from test-path-utils.c
rename to test/path-utils.c
diff --git a/test-run-command.c b/test/run-command.c
similarity index 100%
rename from test-run-command.c
rename to test/run-command.c
diff --git a/test-sha1.c b/test/sha1.c
similarity index 100%
rename from test-sha1.c
rename to test/sha1.c
diff --git a/test-sigchain.c b/test/sigchain.c
similarity index 100%
rename from test-sigchain.c
rename to test/sigchain.c
diff --git a/test-string-pool.c b/test/string-pool.c
similarity index 100%
rename from test-string-pool.c
rename to test/string-pool.c
diff --git a/test-subprocess.c b/test/subprocess.c
similarity index 100%
rename from test-subprocess.c
rename to test/subprocess.c
diff --git a/test-svn-fe.c b/test/svn-fe.c
similarity index 100%
rename from test-svn-fe.c
rename to test/svn-fe.c
diff --git a/test-treap.c b/test/treap.c
similarity index 100%
rename from test-treap.c
rename to test/treap.c
-- 
1.7.4.74.g639db
Next: Nguyen Thai Ngoc Duy
Message 1 of 54 in “Move test-*.c to test/ subdirectory”
  1. Move test-*.c to test/ subdirectoryNguyễn Thái Ngọc Duy, Feb 9, 2011
  2. Nguyen Thai Ngoc DuyFeb 9, 2011
  3. Junio C HamanoFeb 9, 2011
  4. Move test-* to t/helper/ subdirectoryNguyễn Thái Ngọc Duy, Feb 10, 2011
  5. 0/3 Thinning the git toplevel directoryJonathan Nieder, Feb 18, 2011
  6. 1/3 Move libgit.a sources into a libgit/ subdirectoryJonathan Nieder, Feb 18, 2011
  7. Nguyen Thai Ngoc DuyFeb 18, 2011
  8. Jonathan NiederFeb 18, 2011
  9. Jeff KingFeb 18, 2011
  10. Jonathan NiederFeb 18, 2011
  11. Nguyen Thai Ngoc DuyFeb 18, 2011
  12. 2/3 Move test-* into a test-programs/ subdirectoryJonathan Nieder, Feb 18, 2011
  13. 3/3 Move header files into a include/ subdirectoryJonathan Nieder, Feb 18, 2011
  14. Nguyen Thai Ngoc DuyFeb 18, 2011
  15. 6/3 Move remaining header files into a include/ subdirectoryJonathan Nieder, Feb 18, 2011
  16. 4/3 compat: do not use relative paths to refer to git-compat-util.h et alJonathan Nieder, Feb 18, 2011
  17. 5/3 block-sha1: do not use relative path for git-compat-util.hJonathan Nieder, Feb 18, 2011
  18. 6/3 Move git-compat-util.h, strbuf.h, and cache.h to include/Jonathan Nieder, Feb 18, 2011
  19. Nguyen Thai Ngoc DuyFeb 18, 2011
  20. 9/3 Thinning the git toplevel directoryJonathan Nieder, Feb 18, 2011
  21. 7/3 Move test-sha1.sh to test-programs/Jonathan Nieder, Feb 18, 2011
  22. 8/3 Move build helpers to scripts/ subdirectoryJonathan Nieder, Feb 18, 2011
  23. 9/3 Move non-builtin git commands and script libraries to a subdirectoryJonathan Nieder, Feb 18, 2011
  24. Jonathan NiederFeb 18, 2011
  25. Jeff KingFeb 18, 2011
  26. Jonathan NiederFeb 18, 2011
  27. Nguyen Thai Ngoc DuyFeb 18, 2011
  28. Junio C HamanoFeb 18, 2011
  29. Jonathan NiederFeb 19, 2011
  30. Sverre RabbelierFeb 19, 2011
  31. The git_remote_helpers package (Re: [RFC/PATCH 0/3] Thinning the git toplevel directory)Jonathan Nieder, Feb 19, 2011
  32. Jeff KingFeb 22, 2011
  33. Junio C HamanoFeb 22, 2011
  34. Sverre RabbelierFeb 22, 2011
  35. Jeff KingFeb 23, 2011
  36. Jonathan NiederFeb 23, 2011
  37. Jeff KingFeb 23, 2011
  38. Recursive make and variations on the themeJonathan Nieder, Feb 23, 2011
  39. Junio C HamanoFeb 23, 2011
  40. Nicolas PitreFeb 23, 2011
  41. Drew NorthupFeb 23, 2011
  42. Nicolas PitreFeb 24, 2011
  43. Drew NorthupFeb 24, 2011
  44. Nicolas PitreFeb 24, 2011
  45. Jeff KingFeb 24, 2011
  46. Drew NorthupFeb 24, 2011
  47. Piotr KrukowieckiFeb 19, 2011
  48. Junio C HamanoFeb 19, 2011
  49. Jonathan NiederFeb 19, 2011
  50. Piotr KrukowieckiFeb 19, 2011
  51. Piotr KrukowieckiFeb 19, 2011
  52. Advertising the prebuilt htmldocs and manpagesJonathan Nieder, Feb 19, 2011
  53. Junio C HamanoFeb 20, 2011
  54. Jonathan NiederFeb 20, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.