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

[PATCH 1/2] t/Makefile: fix result handling with TEST_OUTPUT_DIRECTORY

From
John Keeping <john@keeping.me.uk>
Date
Apr 26, 2013, 18:55 UTC
Message-ID
<7c0618f3fa7f68b963bf483f1e97afed835bdb74.1367002553.git.john@keeping.me.uk>

When TEST_OUTPUT_DIRECTORY is set, the test results will be generated in "$TEST_OUTPUT_DIRECTORY/test-results", which may not be the same as "test-results" in t/Makefile. This causes the aggregate-results target to fail as it finds no count files.

Fix this by introducing TEST_RESULTS_DIRECTORY and using it wherever test-results is referenced.

Signed-off-by: John Keeping <john@keeping.me.uk>
---
 t/Makefile | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/t/Makefile b/t/Makefile
index 44ca7d3..0e1408d 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -15,9 +15,16 @@ PROVE ?= prove
 DEFAULT_TEST_TARGET ?= test
 TEST_LINT ?= test-lint-duplicates test-lint-executable
 
+ifdef TEST_OUTPUT_DIRECTORY
+TEST_RESULTS_DIRECTORY = $(TEST_RESULTS_DIRECTORY)/test-results
+else
+TEST_RESULTS_DIRECTORY = test-results
+endif
+
 # Shell quote;
 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
 PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
+TEST_RESULTS_DIRECTORY_SQ = $(subst ','\'',$(TEST_RESULTS_DIRECTORY))
 
 T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
 TSVN = $(sort $(wildcard t91[0-9][0-9]-*.sh))
@@ -36,10 +43,10 @@ $(T):
 	@echo "*** $@ ***"; GIT_CONFIG=.git/config '$(SHELL_PATH_SQ)' $@ $(GIT_TEST_OPTS)
 
 pre-clean:
-	$(RM) -r test-results
+	$(RM) -r '$(TEST_RESULTS_DIRECTORY_SQ)'
 
 clean-except-prove-cache:
-	$(RM) -r 'trash directory'.* test-results
+	$(RM) -r 'trash directory'.* '$(TEST_RESULTS_DIRECTORY_SQ)'
 	$(RM) -r valgrind/bin
 
 clean: clean-except-prove-cache
@@ -65,7 +72,7 @@ aggregate-results-and-cleanup: $(T)
 	$(MAKE) clean
 
 aggregate-results:
-	for f in test-results/t*-*.counts; do \
+	for f in '$(TEST_RESULTS_DIRECTORY_SQ)'/t*-*.counts; do \
 		echo "$$f"; \
 	done | '$(SHELL_PATH_SQ)' ./aggregate-results.sh
 
-- 
1.8.2.1.715.gb260f47
Next: John Keeping
Message 1 of 7 in “t/Makefile: fix result handling with TEST_OUTPUT_DIRECTORY”
  1. 1/2 t/Makefile: fix result handling with TEST_OUTPUT_DIRECTORYJohn Keeping, Apr 26, 2013
  2. 2/2 test output: respect $TEST_OUTPUT_DIRECTORYJohn Keeping, Apr 26, 2013
  3. Thomas RastApr 29, 2013
  4. 2/2 test output: respect $TEST_OUTPUT_DIRECTORYJohn Keeping, Apr 29, 2013
  5. Junio C HamanoApr 29, 2013
  6. John KeepingApr 29, 2013
  7. Junio C HamanoApr 29, 2013

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.