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

[PATCH 7/8] Tests: let --valgrind imply --verbose and --tee

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 3, 2009, 23:26 UTC
Message-ID
<alpine.DEB.1.00.0902040026250.9822@pacific.mpi-cbg.de>
In-Reply-To
<cover.1233702893u.git.johannes.schindelin@gmx.de>

It does not make much sense to run the (expensive) valgrind tests and not look at the output.

To prevent output from scrolling out of reach, the parameter --tee is implied, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/Makefile    |    2 +-
 t/README      |    4 ++++
 t/test-lib.sh |    4 ++--
 3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/t/Makefile b/t/Makefile
index e544493..0962341 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -39,6 +39,6 @@ full-svn-test:
 	$(MAKE) $(TSVN) GIT_SVN_NO_OPTIMIZE_COMMITS=0 LC_ALL=en_US.UTF-8
 
 valgrind:
-	GIT_TEST_OPTS='--valgrind -v --tee' $(MAKE) -k
+	GIT_TEST_OPTS=--valgrind $(MAKE)
 
 .PHONY: pre-clean $(T) aggregate-results clean valgrind
diff --git a/t/README b/t/README
index ed1ebb6..d8f6c7d 100644
--- a/t/README
+++ b/t/README
@@ -65,6 +65,10 @@ appropriately before running "make".
 	the test script when running under -i).  Valgrind errors
 	go to stderr, so you might want to pass the -v option, too.
 
+	Since it makes no sense to run the tests with --valgrind and
+	not see any output, this option implies --verbose.  For
+	convenience, it also implies --tee.
+
 --tee::
 	In addition to printing the test output to the terminal,
 	write it to files named 't/test-results/$TEST_NAME.out'.
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 2fb2274..495d55d 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -9,7 +9,7 @@ case "$GIT_TEST_TEE_STARTED, $* " in
 done,*)
 	# do not redirect again
 	;;
-*' --tee '*)
+*' --tee '*|*' --va'*)
 	mkdir -p test-results
 	BASE=test-results/$(basename "$0" .sh)
 	(GIT_TEST_TEE_STARTED=done ${SHELL-sh} "$0" "$@" 2>&1;
@@ -111,7 +111,7 @@ do
 		# noop now...
 		shift ;;
 	--va|--val|--valg|--valgr|--valgri|--valgrin|--valgrind)
-		valgrind=t; shift ;;
+		valgrind=t; verbose=t; shift ;;
 	--tee)
 		shift ;; # was handled already
 	*)
-- 
1.6.1.2.582.g3fdd5
Previous: Johannes SchindelinNext: Jeff King
Message 7 of 11 in “Add valgrind support in test scripts”
  1. 1/8 Add valgrind support in test scriptsJohannes Schindelin, Feb 3, 2009
  2. 2/8 valgrind: ignore ldso and more libz errorsJohannes Schindelin, Feb 3, 2009
  3. 3/8 Valgrind support: check for more than just programming errorsJohannes Schindelin, Feb 3, 2009
  4. 4/8 test-lib.sh: optionally output to test-results/$TEST.out, tooJohannes Schindelin, Feb 3, 2009
  5. 5/8 t/Makefile: provide a 'valgrind' targetJohannes Schindelin, Feb 3, 2009
  6. 6/8 Add a script to coalesce the valgrind outputsJohannes Schindelin, Feb 3, 2009
  7. 7/8 Tests: let --valgrind imply --verbose and --teeJohannes Schindelin, Feb 3, 2009
  8. Jeff KingFeb 6, 2009
  9. Johannes SchindelinFeb 6, 2009
  10. Jeff KingFeb 6, 2009
  11. 8/8 test-lib: avoid assuming that templates/ are in the GIT_EXEC_PATHJohannes Schindelin, Feb 3, 2009

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.