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

[PATCH v3 01/10] t: stop announcing prereqs

From
Patrick Steinhardt <ps@pks.im>
Date
May 30, 2025, 13:31 UTC
Message-ID
<20250530-pks-meson-tap-v3-1-676f5e41f2e4@pks.im>
In-Reply-To
<20250530-pks-meson-tap-v3-0-676f5e41f2e4@pks.im>

We have a couple of cases where our tests end up announcing that a certain prerequisite is or isn't fulfilled. While this is supposed to help the developer it has the downside that it breaks the TAP format.

We could convert these cases to just have a "#" prefix, but it feels rather unlikely that these are generally useful in the first place. We already do announce why a specific test is being skipped, so we should try to use this mechanism to the best extent possible.

Stop announcing these prereqs to fix the TAP format. Where possible, convert the tests to rely on the prerequisites themselves to announce why a test ran or didn't ran.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 t/t0050-filesystem.sh                  | 30 ++++++------------------------
 t/t3600-rm.sh                          |  5 -----
 t/t4000-diff-format.sh                 |  2 +-
 t/t9500-gitweb-standalone-no-errors.sh | 16 +++++++---------
 t/t9903-bash-prompt.sh                 |  4 ----
 5 files changed, 14 insertions(+), 43 deletions(-)
diff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh
index 5c9dc90d0b0..ca8568067d3 100755
--- a/t/t0050-filesystem.sh
+++ b/t/t0050-filesystem.sh
@@ -10,53 +10,35 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 auml=$(printf '\303\244')
 aumlcdiar=$(printf '\141\314\210')
 
-if test_have_prereq CASE_INSENSITIVE_FS
-then
-	say "will test on a case insensitive filesystem"
-	test_case=test_expect_failure
-else
-	test_case=test_expect_success
-fi
-
 if test_have_prereq UTF8_NFD_TO_NFC
 then
-	say "will test on a unicode corrupting filesystem"
 	test_unicode=test_expect_failure
 else
 	test_unicode=test_expect_success
 fi
 
-test_have_prereq SYMLINKS ||
-	say "will test on a filesystem lacking symbolic links"
-
-if test_have_prereq CASE_INSENSITIVE_FS
-then
-test_expect_success "detection of case insensitive filesystem during repo init" '
+test_expect_success CASE_INSENSITIVE_FS "detection of case insensitive filesystem during repo init" '
 	test $(git config --bool core.ignorecase) = true
 '
-else
-test_expect_success "detection of case insensitive filesystem during repo init" '
+
+test_expect_success !CASE_INSENSITIVE_FS "detection of case insensitive filesystem during repo init" '
 	{
 		test_must_fail git config --bool core.ignorecase >/dev/null ||
 			test $(git config --bool core.ignorecase) = false
 	}
 '
-fi
 
-if test_have_prereq SYMLINKS
-then
-test_expect_success "detection of filesystem w/o symlink support during repo init" '
+test_expect_success SYMLINKS "detection of filesystem w/o symlink support during repo init" '
 	{
 		test_must_fail git config --bool core.symlinks ||
 		test "$(git config --bool core.symlinks)" = true
 	}
 '
-else
-test_expect_success "detection of filesystem w/o symlink support during repo init" '
+
+test_expect_success !SYMLINKS "detection of filesystem w/o symlink support during repo init" '
 	v=$(git config --bool core.symlinks) &&
 	test "$v" = false
 '
-fi
 
 test_expect_success "setup case tests" '
 	git config core.ignorecase true &&
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
index 98259e2adaa..1f16e6b5228 100755
--- a/t/t3600-rm.sh
+++ b/t/t3600-rm.sh
@@ -17,11 +17,6 @@ test_expect_success 'Initialize test directory' '
 	git commit -m "add normal files"
 '
 
-if test_have_prereq !FUNNYNAMES
-then
-	say 'Your filesystem does not allow tabs in filenames.'
-fi
-
 test_expect_success FUNNYNAMES 'add files with funny names' '
 	touch -- "tab	embedded" "newline${LF}embedded" &&
 	git add -- "tab	embedded" "newline${LF}embedded" &&
diff --git a/t/t4000-diff-format.sh b/t/t4000-diff-format.sh
index a51f881b1c9..32b14e3a714 100755
--- a/t/t4000-diff-format.sh
+++ b/t/t4000-diff-format.sh
@@ -36,7 +36,7 @@ test_expect_success 'git diff-files -p after editing work tree.' '
 # that's as far as it comes
 if [ "$(git config --get core.filemode)" = false ]
 then
-	say 'filemode disabled on the filesystem'
+	skip_all='filemode disabled on the filesystem'
 	test_done
 fi
 
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index 7679780fb87..578d6c8b329 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -700,19 +700,17 @@ test_expect_success \
 # ----------------------------------------------------------------------
 # syntax highlighting
 
+test_lazy_prereq HIGHLIGHT '
+	highlight_version=$(highlight --version </dev/null 2>/dev/null) &&
+	test -n "$highlight_version"
+'
 
-highlight_version=$(highlight --version </dev/null 2>/dev/null)
-if [ $? -eq 127 ]; then
-	say "Skipping syntax highlighting tests: 'highlight' not found"
-elif test -z "$highlight_version"; then
-	say "Skipping syntax highlighting tests: incorrect 'highlight' found"
-else
-	test_set_prereq HIGHLIGHT
+test_expect_success HIGHLIGHT '
 	cat >>gitweb_config.perl <<-\EOF
 	our $highlight_bin = "highlight";
-	$feature{'highlight'}{'override'} = 1;
+	$feature{"highlight"}{"override"} = 1;
 	EOF
-fi
+'
 
 test_expect_success HIGHLIGHT \
 	'syntax highlighting (no highlight, unknown syntax)' \
diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh
index d667dda654e..637a6f13a6d 100755
--- a/t/t9903-bash-prompt.sh
+++ b/t/t9903-bash-prompt.sh
@@ -66,10 +66,6 @@ test_expect_success 'prompt - unborn branch' '
 	test_cmp expected "$actual"
 '
 
-if test_have_prereq !FUNNYNAMES; then
-	say 'Your filesystem does not allow newlines in filenames.'
-fi
-
 test_expect_success FUNNYNAMES 'prompt - with newline in path' '
     repo_with_newline="repo
 with
-- 
2.50.0.rc0.604.gd4ff7b7c86.dirty
Previous: Patrick SteinhardtNext: Karthik Nayak
Message 48 of 79 in “meson: parse TAP output generated by our tests”
  1. 0/4 meson: parse TAP output generated by our testsPatrick Steinhardt, May 6, 2025
  2. 1/4 t: fix cases where output breaks TAP formatPatrick Steinhardt, May 6, 2025
  3. Phillip WoodMay 6, 2025
  4. Patrick SteinhardtMay 7, 2025
  5. Phillip WoodMay 7, 2025
  6. Karthik NayakMay 14, 2025
  7. 2/4 t/test-lib: don't print shell traces to stdoutPatrick Steinhardt, May 6, 2025
  8. 3/4 meson: introduce kwargs variable for testsPatrick Steinhardt, May 6, 2025
  9. Karthik NayakMay 15, 2025
  10. 4/4 meson: parse TAP output generated by our testsPatrick Steinhardt, May 6, 2025
  11. Karthik NayakMay 15, 2025
  12. Patrick SteinhardtMay 15, 2025
  13. Karthik NayakMay 15, 2025
  14. Patrick SteinhardtMay 6, 2025
  15. Patrick SteinhardtMay 7, 2025
  16. Patrick SteinhardtMay 21, 2025
  17. Hridoy AhmedMay 21, 2025
  18. Junio C HamanoMay 21, 2025
  19. Junio C HamanoMay 21, 2025
  20. Patrick SteinhardtMay 23, 2025
  21. Patrick SteinhardtMay 23, 2025
  22. Junio C HamanoMay 23, 2025
  23. Ramsay JonesMay 23, 2025
  24. Ramsay JonesMay 23, 2025
  25. Junio C HamanoMay 23, 2025
  26. Patrick SteinhardtMay 26, 2025
  27. Phillip WoodMay 26, 2025
  28. Todd ZullingerMay 26, 2025
  29. Eli SchwartzMay 26, 2025
  30. Patrick SteinhardtMay 26, 2025
  31. Junio C HamanoMay 27, 2025
  32. Patrick SteinhardtMay 28, 2025
  33. Junio C HamanoMay 27, 2025
  34. 0/6 meson: parse TAP output generated by our testsPatrick Steinhardt, May 27, 2025
  35. 1/6 t: fix cases where output breaks TAP formatPatrick Steinhardt, May 27, 2025
  36. Eric SunshineMay 27, 2025
  37. Patrick SteinhardtMay 28, 2025
  38. Eric SunshineMay 28, 2025
  39. Patrick SteinhardtMay 30, 2025
  40. 2/6 t/test-lib: don't print shell traces to stdoutPatrick Steinhardt, May 27, 2025
  41. Junio C HamanoMay 27, 2025
  42. Patrick SteinhardtMay 28, 2025
  43. 3/6 t/test-lib: fix TAP format for BASH_XTRACEFD warningPatrick Steinhardt, May 27, 2025
  44. 4/6 t7815: fix unexpectedly passing test on macOSPatrick Steinhardt, May 27, 2025
  45. 6/6 meson: parse TAP output generated by our testsPatrick Steinhardt, May 27, 2025
  46. 5/6 meson: introduce kwargs variable for testsPatrick Steinhardt, May 27, 2025
  47. 00/10 meson: parse TAP output generated by our testsPatrick Steinhardt, May 30, 2025
  48. 01/10 t: stop announcing prereqsPatrick Steinhardt, May 30, 2025
  49. Karthik NayakMay 31, 2025
  50. 03/10 t9822: use prereq to check for ISO-8859-1 supportPatrick Steinhardt, May 30, 2025
  51. 02/10 t: silence output from `test_create_repo()`Patrick Steinhardt, May 30, 2025
  52. Eric SunshineMay 30, 2025
  53. 04/10 t983*: use prereq to check for Python-specific git-b4(1) supportPatrick Steinhardt, May 30, 2025
  54. Todd ZullingerMay 30, 2025
  55. Patrick SteinhardtMay 30, 2025
  56. 05/10 t/test-lib: don't print shell traces to stdoutPatrick Steinhardt, May 30, 2025
  57. Karthik NayakMay 31, 2025
  58. 06/10 t/test-lib: fix TAP format for BASH_XTRACEFD warningPatrick Steinhardt, May 30, 2025
  59. Karthik NayakMay 31, 2025
  60. 07/10 t7815: fix unexpectedly passing test on macOSPatrick Steinhardt, May 30, 2025
  61. Karthik NayakMay 31, 2025
  62. Kristoffer HaugsbakkJun 1, 2025
  63. Patrick SteinhardtJun 2, 2025
  64. 08/10 test-lib: fail on unexpectedly passing testsPatrick Steinhardt, May 30, 2025
  65. 09/10 meson: introduce kwargs variable for testsPatrick Steinhardt, May 30, 2025
  66. 10/10 meson: parse TAP output generated by our testsPatrick Steinhardt, May 30, 2025
  67. Karthik NayakMay 31, 2025
  68. 00/10 meson: parse TAP output generated by our testsPatrick Steinhardt, Jun 2, 2025
  69. 01/10 t: stop announcing prereqsPatrick Steinhardt, Jun 2, 2025
  70. 02/10 t: silence output from `test_create_repo()`Patrick Steinhardt, Jun 2, 2025
  71. 03/10 t9822: use prereq to check for ISO-8859-1 supportPatrick Steinhardt, Jun 2, 2025
  72. 04/10 t983*: use prereq to check for Python-specific git-p4(1) supportPatrick Steinhardt, Jun 2, 2025
  73. 06/10 t/test-lib: fix TAP format for BASH_XTRACEFD warningPatrick Steinhardt, Jun 2, 2025
  74. 05/10 t/test-lib: don't print shell traces to stdoutPatrick Steinhardt, Jun 2, 2025
  75. 08/10 test-lib: fail on unexpectedly passing testsPatrick Steinhardt, Jun 2, 2025
  76. 07/10 t7815: fix unexpectedly passing test on macOSPatrick Steinhardt, Jun 2, 2025
  77. 09/10 meson: introduce kwargs variable for testsPatrick Steinhardt, Jun 2, 2025
  78. 10/10 meson: parse TAP output generated by our testsPatrick Steinhardt, Jun 2, 2025
  79. Karthik NayakJun 2, 2025

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.