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

Re: [PATCH] use "git init-db" in tests

From
Junio C Hamano <junkio@cox.net>
Date
Dec 9, 2005, 08:52 UTC
Message-ID
<7vvexy4ppw.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7vlkyu7l05.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
> Linkage error of git-init-db (or git wrapper) may leave the file
> created but leave that in unexecutable form, which could be a
> valid concern, but that would signal an error to the make during
> the build stage, and "test" target depends on "all" target.

BTW, I sometimes wished if it were easier to disable that "test: all" dependency and run tests without building things first, i.e. deliberately using the already installed binaries, so that I can make sure that updated or new tests reproduce and catch problems with the existing code first and then make sure the binaries built from the updated sources fix the problem.

Of course that is a very specialized application so a makefile variable "make NO_BUILD_BEFORE_TEST=YesPlease test" would not make much sense, but I could have done something like this:

---
diff --git a/Makefile b/Makefile
index 01b6643..8dd7be7 100644
--- a/Makefile
+++ b/Makefile
@@ -439,7 +439,13 @@ doc:
 
 ### Testing rules
 
-test: all
+ifdef NO_BUILD_BEFORE_TEST
+test_depends = 
+else
+test_depends = all
+endif
+
+test: $(test_depends)
 	$(MAKE) -C t/ all
 
 test-date$X: test-date.c date.o ctype.o
Previous: Junio C HamanoNext: Petr Baudis
Message 7 of 11 in “use "git init-db" in tests”
  1. use "git init-db" in testsAlex Riesen, Dec 8, 2005
  2. Junio C HamanoDec 8, 2005
  3. Alex RiesenDec 8, 2005
  4. Junio C HamanoDec 8, 2005
  5. Alex RiesenDec 9, 2005
  6. Junio C HamanoDec 9, 2005
  7. Junio C HamanoDec 9, 2005
  8. Petr BaudisDec 9, 2005
  9. Alex RiesenDec 9, 2005
  10. Junio C HamanoDec 9, 2005
  11. Alex RiesenDec 8, 2005

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.