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

[PATCH v4 07/20] t: adapt existing PERL prerequisites

From
Patrick Steinhardt <ps@pks.im>
Date
Apr 3, 2025, 05:05 UTC
Message-ID
<20250403-b4-pks-t-perlless-v4-7-be20ac3db39a@pks.im>
In-Reply-To
<20250403-b4-pks-t-perlless-v4-0-be20ac3db39a@pks.im>

A couple of our tests depend on the PERL prerequisite even though it isn't needed. These tests fall into one of the following classes:

  - The underlying logic used to be implemented in Perl but isn't
    anymore. Here we can simply drop the dependency altogether.
  - The test logic used to depend on Perl but doesn't anymore. Again, we
    can simply drop the dependency.
  - The test logic still relies on a Perl interpreter. These tests
    should use the newly introduced PERL_TEST_HELPERS prerequisite.
Adapt test cases accordingly.

Note that in t1006 we have to introduce another new prerequisite depending on whether or not the IPC::Open2 module is available. Funny enough, when starting to use `test_lazy_prereq` to do so we also get a conflict of variables with the "script" variable that contains the Perl logic because `test_run_lazy_prereq_` also sets that variable. We thus rename the variable in t1006 to "perl_script".

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 t/t0021-conversion.sh                 | 10 +++++-----
 t/t0090-cache-tree.sh                 |  4 ++--
 t/t1006-cat-file.sh                   | 14 +++++++++-----
 t/t7501-commit-basic-functionality.sh |  6 +++---
 4 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index 9c3738ebb3f..4a892a91780 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -841,7 +841,7 @@ test_expect_success 'process filter abort stops processing of all further files'
 	)
 '
 
-test_expect_success PERL 'invalid process filter must fail (and not hang!)' '
+test_expect_success 'invalid process filter must fail (and not hang!)' '
 	test_config_global filter.protocol.process cat &&
 	test_config_global filter.protocol.required true &&
 	rm -rf repo &&
@@ -1111,19 +1111,19 @@ do
 	branch) opt='-f HEAD' ;;
 	esac
 
-	test_expect_success PERL,TTY "delayed checkout shows progress by default on tty ($mode checkout)" '
+	test_expect_success TTY "delayed checkout shows progress by default on tty ($mode checkout)" '
 		test_delayed_checkout_progress test_terminal git checkout $opt
 	'
 
-	test_expect_success PERL "delayed checkout omits progress on non-tty ($mode checkout)" '
+	test_expect_success "delayed checkout omits progress on non-tty ($mode checkout)" '
 		test_delayed_checkout_progress ! git checkout $opt
 	'
 
-	test_expect_success PERL,TTY "delayed checkout omits progress with --quiet ($mode checkout)" '
+	test_expect_success TTY "delayed checkout omits progress with --quiet ($mode checkout)" '
 		test_delayed_checkout_progress ! test_terminal git checkout --quiet $opt
 	'
 
-	test_expect_success PERL,TTY "delayed checkout honors --[no]-progress ($mode checkout)" '
+	test_expect_success TTY "delayed checkout honors --[no]-progress ($mode checkout)" '
 		test_delayed_checkout_progress ! test_terminal git checkout --no-progress $opt &&
 		test_delayed_checkout_progress test_terminal git checkout --quiet --progress $opt
 	'
diff --git a/t/t0090-cache-tree.sh b/t/t0090-cache-tree.sh
index ab80c9ef135..d9015882946 100755
--- a/t/t0090-cache-tree.sh
+++ b/t/t0090-cache-tree.sh
@@ -128,7 +128,7 @@ test_expect_success 'second commit has cache-tree' '
 	test_cache_tree
 '
 
-test_expect_success PERL 'commit --interactive gives cache-tree on partial commit' '
+test_expect_success 'commit --interactive gives cache-tree on partial commit' '
 	test_when_finished "git reset --hard" &&
 	cat <<-\EOT >foo.c &&
 	int foo()
@@ -162,7 +162,7 @@ test_expect_success PERL 'commit --interactive gives cache-tree on partial commi
 	test_cache_tree expected.status
 '
 
-test_expect_success PERL 'commit -p with shrinking cache-tree' '
+test_expect_success 'commit -p with shrinking cache-tree' '
 	mkdir -p deep/very-long-subdir &&
 	echo content >deep/very-long-subdir/file &&
 	git add deep &&
diff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh
index a574da3df53..0a22b0a7b8e 100755
--- a/t/t1006-cat-file.sh
+++ b/t/t1006-cat-file.sh
@@ -1323,7 +1323,7 @@ test_expect_success 'batch-command flush without --buffer' '
 	grep "^fatal:.*flush is only for --buffer mode.*" err
 '
 
-script='
+perl_script='
 use warnings;
 use strict;
 use IPC::Open2;
@@ -1345,12 +1345,16 @@ $? == 0 or die "\$?=$?";
 
 expect="$hello_oid blob $hello_size"
 
-test_expect_success PERL '--batch-check is unbuffered by default' '
-	perl -e "$script" -- --batch-check $hello_oid "$expect"
+test_lazy_prereq PERL_IPC_OPEN2 '
+	perl -MIPC::Open2 -e "exit 0"
 '
 
-test_expect_success PERL '--batch-command info is unbuffered by default' '
-	perl -e "$script" -- --batch-command $hello_oid "$expect" "info "
+test_expect_success PERL_IPC_OPEN2 '--batch-check is unbuffered by default' '
+	perl -e "$perl_script" -- --batch-check $hello_oid "$expect"
+'
+
+test_expect_success PERL_IPC_OPEN2 '--batch-command info is unbuffered by default' '
+	perl -e "$perl_script" -- --batch-command $hello_oid "$expect" "info "
 '
 
 test_done
diff --git a/t/t7501-commit-basic-functionality.sh b/t/t7501-commit-basic-functionality.sh
index cc12f99f115..a37509f0043 100755
--- a/t/t7501-commit-basic-functionality.sh
+++ b/t/t7501-commit-basic-functionality.sh
@@ -46,7 +46,7 @@ test_expect_success 'paths and -a do not mix' '
 	test_must_fail git commit -m foo -a file
 '
 
-test_expect_success PERL 'can use paths with --interactive' '
+test_expect_success 'can use paths with --interactive' '
 	echo bong-o-bong >file &&
 	# 2: update, 1:st path, that is all, 7: quit
 	test_write_lines 2 1 "" 7 |
@@ -345,12 +345,12 @@ test_expect_success 'overriding author from command line' '
 	grep Rubber.Duck output
 '
 
-test_expect_success PERL 'interactive add' '
+test_expect_success 'interactive add' '
 	echo 7 | test_must_fail git commit --interactive >out &&
 	grep "What now" out
 '
 
-test_expect_success PERL "commit --interactive doesn't change index if editor aborts" '
+test_expect_success "commit --interactive doesn't change index if editor aborts" '
 	echo zoo >file &&
 	test_must_fail git diff --exit-code >diff1 &&
 	test_write_lines u "*" q |
-- 
2.49.0.604.gff1f9ca942.dirty
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 106 of 125 in “t: drop Perl as a mandatory prerequisite”
  1. 00/20 t: drop Perl as a mandatory prerequisitePatrick Steinhardt, Mar 20, 2025
  2. 01/20 t: skip chain lint when PERL_PATH is unsetPatrick Steinhardt, Mar 20, 2025
  3. Eric SunshineMar 20, 2025
  4. 02/20 t: refactor environment sanitization to not use PerlPatrick Steinhardt, Mar 20, 2025
  5. Karthik NayakMar 21, 2025
  6. 03/20 t: adapt character translation helpers to not use PerlPatrick Steinhardt, Mar 20, 2025
  7. 04/20 t: adapt `test_copy_bytes()` to not use PerlPatrick Steinhardt, Mar 20, 2025
  8. Karthik NayakMar 21, 2025
  9. 05/20 t: adapt `test_readlink()` to not use PerlPatrick Steinhardt, Mar 20, 2025
  10. 06/20 t: introduce PERL_TEST_HELPERS prerequisitePatrick Steinhardt, Mar 20, 2025
  11. Eric SunshineMar 20, 2025
  12. Patrick SteinhardtMar 24, 2025
  13. 07/20 t: adapt existing PERL prerequisitesPatrick Steinhardt, Mar 20, 2025
  14. 08/20 meson: stop requiring Perl when tests are enabledPatrick Steinhardt, Mar 20, 2025
  15. 09/20 Makefile: stop requiring Perl when running testsPatrick Steinhardt, Mar 20, 2025
  16. 11/20 t: refactor tests depending on Perl substitution operatorPatrick Steinhardt, Mar 20, 2025
  17. Phillip WoodMar 24, 2025
  18. 10/20 t: refactor tests depending on Perl transliteration operatorPatrick Steinhardt, Mar 20, 2025
  19. 13/20 t: refactor tests depending on Perl for textconv scriptsPatrick Steinhardt, Mar 20, 2025
  20. Eric SunshineMar 20, 2025
  21. Patrick SteinhardtMar 24, 2025
  22. Eric SunshineMar 24, 2025
  23. Patrick SteinhardtMar 25, 2025
  24. Phillip WoodMar 24, 2025
  25. Patrick SteinhardtMar 25, 2025
  26. 12/20 t: refactor tests depending on Perl to print dataPatrick Steinhardt, Mar 20, 2025
  27. Eric SunshineMar 20, 2025
  28. Patrick SteinhardtMar 24, 2025
  29. 14/20 t/lib-gpg: refactor `sanitize_pgp()` to not depend on PerlPatrick Steinhardt, Mar 20, 2025
  30. 15/20 t/lib-t6000: refactor `name_from_description()` to not depend on PerlPatrick Steinhardt, Mar 20, 2025
  31. Eric SunshineMar 20, 2025
  32. Patrick SteinhardtMar 24, 2025
  33. 16/20 t/lib-httpd: refactor "one-time-perl" CGI script to not depend on PerlPatrick Steinhardt, Mar 20, 2025
  34. 17/20 t0021: refactor `generate_random_characters()` to not depend on PerlPatrick Steinhardt, Mar 20, 2025
  35. 18/20 t0210: refactor trace2 scrubbing to not use PerlPatrick Steinhardt, Mar 20, 2025
  36. 19/20 t5316: refactor `max_chain()` to not depend on PerlPatrick Steinhardt, Mar 20, 2025
  37. 20/20 t5703: refactor test to not depend on PerlPatrick Steinhardt, Mar 20, 2025
  38. 00/20 t: drop Perl as a mandatory prerequisitePatrick Steinhardt, Mar 25, 2025
  39. 01/20 t: skip chain lint when PERL_PATH is unsetPatrick Steinhardt, Mar 25, 2025
  40. 02/20 t: refactor environment sanitization to not use PerlPatrick Steinhardt, Mar 25, 2025
  41. 03/20 t: adapt character translation helpers to not use PerlPatrick Steinhardt, Mar 25, 2025
  42. 05/20 t: adapt `test_readlink()` to not use PerlPatrick Steinhardt, Mar 25, 2025
  43. 04/20 t: adapt `test_copy_bytes()` to not use PerlPatrick Steinhardt, Mar 25, 2025
  44. 06/20 t: introduce PERL_TEST_HELPERS prerequisitePatrick Steinhardt, Mar 25, 2025
  45. 08/20 meson: stop requiring Perl when tests are enabledPatrick Steinhardt, Mar 25, 2025
  46. 07/20 t: adapt existing PERL prerequisitesPatrick Steinhardt, Mar 25, 2025
  47. 09/20 Makefile: stop requiring Perl when running testsPatrick Steinhardt, Mar 25, 2025
  48. 10/20 t: refactor tests depending on Perl transliteration operatorPatrick Steinhardt, Mar 25, 2025
  49. 11/20 t: refactor tests depending on Perl substitution operatorPatrick Steinhardt, Mar 25, 2025
  50. Phillip WoodMar 25, 2025
  51. Patrick SteinhardtMar 27, 2025
  52. 13/20 t: refactor tests depending on Perl for textconv scriptsPatrick Steinhardt, Mar 25, 2025
  53. 12/20 t: refactor tests depending on Perl to print dataPatrick Steinhardt, Mar 25, 2025
  54. 14/20 t/lib-gpg: refactor `sanitize_pgp()` to not depend on PerlPatrick Steinhardt, Mar 25, 2025
  55. 15/20 t/lib-t6000: refactor `name_from_description()` to not depend on PerlPatrick Steinhardt, Mar 25, 2025
  56. 16/20 t/lib-httpd: refactor "one-time-perl" CGI script to not depend on PerlPatrick Steinhardt, Mar 25, 2025
  57. 17/20 t0021: refactor `generate_random_characters()` to not depend on PerlPatrick Steinhardt, Mar 25, 2025
  58. 18/20 t0210: refactor trace2 scrubbing to not use PerlPatrick Steinhardt, Mar 25, 2025
  59. 19/20 t5316: refactor `max_chain()` to not depend on PerlPatrick Steinhardt, Mar 25, 2025
  60. 20/20 t5703: refactor test to not depend on PerlPatrick Steinhardt, Mar 25, 2025
  61. 00/20 t: drop Perl as a mandatory prerequisitePatrick Steinhardt, Mar 27, 2025
  62. 01/20 t: skip chain lint when PERL_PATH is unsetPatrick Steinhardt, Mar 27, 2025
  63. 03/20 t: adapt character translation helpers to not use PerlPatrick Steinhardt, Mar 27, 2025
  64. 02/20 t: refactor environment sanitization to not use PerlPatrick Steinhardt, Mar 27, 2025
  65. 04/20 t: adapt `test_copy_bytes()` to not use PerlPatrick Steinhardt, Mar 27, 2025
  66. 05/20 t: adapt `test_readlink()` to not use PerlPatrick Steinhardt, Mar 27, 2025
  67. 07/20 t: adapt existing PERL prerequisitesPatrick Steinhardt, Mar 27, 2025
  68. 06/20 t: introduce PERL_TEST_HELPERS prerequisitePatrick Steinhardt, Mar 27, 2025
  69. Johannes SchindelinApr 1, 2025
  70. Patrick SteinhardtApr 2, 2025
  71. Johannes SchindelinApr 2, 2025
  72. Patrick SteinhardtApr 3, 2025
  73. 09/20 Makefile: stop requiring Perl when running testsPatrick Steinhardt, Mar 27, 2025
  74. 08/20 meson: stop requiring Perl when tests are enabledPatrick Steinhardt, Mar 27, 2025
  75. 10/20 t: refactor tests depending on Perl transliteration operatorPatrick Steinhardt, Mar 27, 2025
  76. 11/20 t: refactor tests depending on Perl substitution operatorPatrick Steinhardt, Mar 27, 2025
  77. Johannes SchindelinApr 1, 2025
  78. Patrick SteinhardtApr 2, 2025
  79. 12/20 t: refactor tests depending on Perl to print dataPatrick Steinhardt, Mar 27, 2025
  80. Johannes SchindelinApr 1, 2025
  81. Patrick SteinhardtApr 2, 2025
  82. 13/20 t: refactor tests depending on Perl for textconv scriptsPatrick Steinhardt, Mar 27, 2025
  83. Johannes SchindelinApr 1, 2025
  84. Patrick SteinhardtApr 2, 2025
  85. Johannes SchindelinApr 2, 2025
  86. 14/20 t/lib-gpg: refactor `sanitize_pgp()` to not depend on PerlPatrick Steinhardt, Mar 27, 2025
  87. Johannes SchindelinApr 1, 2025
  88. Patrick SteinhardtApr 2, 2025
  89. 15/20 t/lib-t6000: refactor `name_from_description()` to not depend on PerlPatrick Steinhardt, Mar 27, 2025
  90. 16/20 t/lib-httpd: refactor "one-time-perl" CGI script to not depend on PerlPatrick Steinhardt, Mar 27, 2025
  91. 17/20 t0021: refactor `generate_random_characters()` to not depend on PerlPatrick Steinhardt, Mar 27, 2025
  92. Johannes SchindelinApr 1, 2025
  93. Patrick SteinhardtApr 2, 2025
  94. 18/20 t0210: refactor trace2 scrubbing to not use PerlPatrick Steinhardt, Mar 27, 2025
  95. 19/20 t5316: refactor `max_chain()` to not depend on PerlPatrick Steinhardt, Mar 27, 2025
  96. 20/20 t5703: refactor test to not depend on PerlPatrick Steinhardt, Mar 27, 2025
  97. Phillip WoodMar 28, 2025
  98. Johannes SchindelinApr 2, 2025
  99. 00/20 t: drop Perl as a mandatory prerequisitePatrick Steinhardt, Apr 3, 2025
  100. 01/20 t: skip chain lint when PERL_PATH is unsetPatrick Steinhardt, Apr 3, 2025
  101. 02/20 t: refactor environment sanitization to not use PerlPatrick Steinhardt, Apr 3, 2025
  102. 03/20 t: adapt character translation helpers to not use PerlPatrick Steinhardt, Apr 3, 2025
  103. 04/20 t: adapt `test_copy_bytes()` to not use PerlPatrick Steinhardt, Apr 3, 2025
  104. 05/20 t: adapt `test_readlink()` to not use PerlPatrick Steinhardt, Apr 3, 2025
  105. 06/20 t: introduce PERL_TEST_HELPERS prerequisitePatrick Steinhardt, Apr 3, 2025
  106. 07/20 t: adapt existing PERL prerequisitesPatrick Steinhardt, Apr 3, 2025
  107. 08/20 meson: stop requiring Perl when tests are enabledPatrick Steinhardt, Apr 3, 2025
  108. 09/20 Makefile: stop requiring Perl when running testsPatrick Steinhardt, Apr 3, 2025
  109. 10/20 t: refactor tests depending on Perl transliteration operatorPatrick Steinhardt, Apr 3, 2025
  110. 11/20 t: refactor tests depending on Perl substitution operatorPatrick Steinhardt, Apr 3, 2025
  111. 13/20 t: refactor tests depending on Perl for textconv scriptsPatrick Steinhardt, Apr 3, 2025
  112. 14/20 t/lib-gpg: refactor `sanitize_pgp()` to not depend on PerlPatrick Steinhardt, Apr 3, 2025
  113. 12/20 t: refactor tests depending on Perl to print dataPatrick Steinhardt, Apr 3, 2025
  114. SZEDER GáborJun 10, 2025
  115. Junio C HamanoJun 10, 2025
  116. Patrick SteinhardtJul 7, 2025
  117. Junio C HamanoJun 10, 2025
  118. 15/20 t/lib-t6000: refactor `name_from_description()` to not depend on PerlPatrick Steinhardt, Apr 3, 2025
  119. 17/20 t0021: refactor `generate_random_characters()` to not depend on PerlPatrick Steinhardt, Apr 3, 2025
  120. 16/20 t/lib-httpd: refactor "one-time-perl" CGI script to not depend on PerlPatrick Steinhardt, Apr 3, 2025
  121. 18/20 t0210: refactor trace2 scrubbing to not use PerlPatrick Steinhardt, Apr 3, 2025
  122. 19/20 t5316: refactor `max_chain()` to not depend on PerlPatrick Steinhardt, Apr 3, 2025
  123. 20/20 t5703: refactor test to not depend on PerlPatrick Steinhardt, Apr 3, 2025
  124. Johannes SchindelinApr 3, 2025
  125. Junio C HamanoApr 8, 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.