From bbb6d43d7a166e7207e80b03dbbf5778ce646d32 Mon Sep 17 00:00:00 2001 From: Taylor Blau Date: Wed, 5 Sep 2018 10:55:50 -0400 Subject: [PATCH 1/2] t/Makefile: refer to TEST_SRCS instead of pattern In preparation to mark test sources as .PHONY, let's keep track of a list of them so that we can eventually write: .PHONY : $(TEST_SRCS) In the meantime, we'll replace the pattern "./t-%.sh", which will not introduce a meaningful behavior change. --- t/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/t/Makefile b/t/Makefile index 846063df..95b3b1d5 100644 --- a/t/Makefile +++ b/t/Makefile @@ -19,6 +19,8 @@ TEST_CMDS += ../bin/lfstest-gitserver$X TEST_CMDS += ../bin/lfstest-standalonecustomadapter$X TEST_CMDS += ../bin/lfstest-testutils$X +TEST_SRCS = $(wildcard t-*.sh) + all : $(DEFAULT_TEST_TARGET) test : $(TEST_CMDS) @@ -27,7 +29,7 @@ test : $(TEST_CMDS) $(PROVE) $(PROVE_EXTRA_ARGS) ./t-*.sh @GIT_LFS_NO_TEST_COUNT= bash -c '. ./testenv.sh && shutdown' -./t-%.sh : $(TEST_CMDS) +$(TEST_SRCS) : $(TEST_CMDS) $(RM) -r remote test_count{,.lock} $(PROVE) -v $(PROVE_EXTRA_ARGS) $@ From f8147219fda9278c6f3697a72a1738862105fa31 Mon Sep 17 00:00:00 2001 From: Taylor Blau Date: Wed, 5 Sep 2018 10:57:00 -0400 Subject: [PATCH 2/2] t/Makefile: mark test sources as .PHONY We have used 'make' in the testing directory 't' to help run integration tests, including starting and stopping a Git LFS test server, and environmental setup bits. We do so by writing a recipe that matches all testing files that we'd want to run, and then running commands based on which one we picked. Since we don't generate a file that was missing when running one of these sources, 'make' will say that the file is up-to-date, unless we run with 'make -B' (to force a re-make). This is annoying to type, and can be avoided by marking the test targets as .PHONY, indicating that they don't produce a file, and are instead synthetic targets that can be run repeatedly without `make`'s up-to-date checking. --- t/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/t/Makefile b/t/Makefile index 95b3b1d5..a1cb5611 100644 --- a/t/Makefile +++ b/t/Makefile @@ -29,6 +29,7 @@ test : $(TEST_CMDS) $(PROVE) $(PROVE_EXTRA_ARGS) ./t-*.sh @GIT_LFS_NO_TEST_COUNT= bash -c '. ./testenv.sh && shutdown' +.PHONY : $(TEST_SRCS) $(TEST_SRCS) : $(TEST_CMDS) $(RM) -r remote test_count{,.lock} $(PROVE) -v $(PROVE_EXTRA_ARGS) $@