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

[PATCH] test-lib: Ignore --quiet under a TAP harness

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jul 31, 2010, 16:40 UTC
Message-ID
<1280594405-31572-1-git-send-email-avarab@gmail.com>

Running the tests with --quiet under a TAP harness will always fail, since a TAP harness always needs actual test output to go along with the plan that's being emitted.

Change the test-lib.sh to ignore the --quiet option under HARNESS_ACTIVE to work around this. Then users that have --quiet in their GIT_TEST_OPTS can run tests under prove(1) without everything breaking.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/test-lib.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index e5523dd..4b95138 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -127,7 +127,9 @@ do
 	-v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
 		verbose=t; shift ;;
 	-q|--q|--qu|--qui|--quie|--quiet)
-		quiet=t; shift ;;
+		# Ignore --quiet under a TAP::Harness. Saying how many tests
+		# passed without the ok/not ok details is always an error.
+		test -z "$HARNESS_ACTIVE" && quiet=t; shift ;;
 	--with-dashes)
 		with_dashes=t; shift ;;
 	--no-color)
-- 
1.7.1
Message 1 of 1 in “test-lib: Ignore --quiet under a TAP harness”
  1. test-lib: Ignore --quiet under a TAP harnessÆvar Arnfjörð Bjarmason, Jul 31, 2010

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.