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

[PATCH] tests: simplify "missing PREREQ" message

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 24, 2010, 07:34 UTC
Message-ID
<20100824073410.GA5562@burratino>
In-Reply-To
<1281528278-15659-1-git-send-email-avarab@gmail.com>

When a test has no prerequisites satisfied (the usual case), instead of "missing THING of THING", just say "missing THING". This does not affect the output when a test is skipped due to a missing prerequisites if another prerequisite is satisfied.

For example: instead of
 ok 8 # skip notes work (missing EXPENSIVE of EXPENSIVE)
 ok 9 # skip notes timing with /usr/bin/time (missing EXPENSIVE of USR_BIN_TIME,EXPENSIVE)
write
 ok 8 # skip notes work (missing EXPENSIVE)
 ok 9 # skip notes timing with /usr/bin/time (missing EXPENSIVE of USR_BIN_TIME,EXPENSIVE)
Cc: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Noticed this when building "next".  Thoughts?
 t/test-lib.sh |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 4617998..c9193cb 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -417,8 +417,14 @@ test_skip () {
 	fi
 	case "$to_skip" in
 	t)
+		of_prereq=
+		if test "$missing_prereq" != "$prereq"
+		then
+			of_prereq=" of $prereq"
+		fi
+
 		say_color skip >&3 "skipping test: $@"
-		say_color skip "ok $test_count # skip $1 (missing $missing_prereq of $prereq)"
+		say_color skip "ok $test_count # skip $1 (missing $missing_prereq${of_prereq})"
 		: true
 		;;
 	*)
-- 
1.7.2.2
Previous: Johannes SixtNext: Johannes Sixt
Message 5 of 7 in “test-lib: Multi-prereq support only checked the last prereq”
  1. test-lib: Multi-prereq support only checked the last prereqÆvar Arnfjörð Bjarmason, Aug 10, 2010
  2. Jonathan NiederAug 11, 2010
  3. test-lib: Multi-prereq support only checked the last prereqÆvar Arnfjörð Bjarmason, Aug 11, 2010
  4. Johannes SixtAug 13, 2010
  5. tests: simplify "missing PREREQ" messageJonathan Nieder, Aug 24, 2010
  6. Johannes SixtAug 24, 2010
  7. Junio C HamanoAug 24, 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.