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

Subsystems: kernel build + files below scripts/ (unless maintained elsewhere), the rest

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:14

Junio C Hamano [off-list ref] 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

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

From: Petr Baudis <hidden>
Date: 2016-06-15 22:42:14

Dear diary, on Fri, Dec 09, 2005 at 09:52:27AM CET, I got a letter
where Junio C Hamano [off-list ref] said that...
Junio C Hamano [off-list ref] writes:
quoted
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:
I think having "test-standalone" or "test-nobuild" or whatever rule and

	test: all test-nobuild

	test-nobuild:
		...

would be much more elegant.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help