aboutsummaryrefslogtreecommitdiffstats
path: root/t/test-lib-functions.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-04-16 13:54:20 -0700
committerJunio C Hamano <gitster@pobox.com>2025-04-16 13:54:20 -0700
commit9bdd7ecf7ec90433fc1803bf5d608d08857b3b49 (patch)
treed5db1e2a0dbdfd5c217198e42f80975e81932d60 /t/test-lib-functions.sh
parentMerge branch 'jt/help-sha-backend-info-in-build-options' (diff)
parentt5703: refactor test to not depend on Perl (diff)
downloadgit-9bdd7ecf7ec90433fc1803bf5d608d08857b3b49.tar.gz
git-9bdd7ecf7ec90433fc1803bf5d608d08857b3b49.zip
Merge branch 'ps/test-wo-perl-prereq'
"make test" used to have a hard dependency on (basic) Perl; tests have been rewritten help environment with NO_PERL test the build as much as possible. * ps/test-wo-perl-prereq: t5703: refactor test to not depend on Perl t5316: refactor `max_chain()` to not depend on Perl t0210: refactor trace2 scrubbing to not use Perl t0021: refactor `generate_random_characters()` to not depend on Perl t/lib-httpd: refactor "one-time-perl" CGI script to not depend on Perl t/lib-t6000: refactor `name_from_description()` to not depend on Perl t/lib-gpg: refactor `sanitize_pgp()` to not depend on Perl t: refactor tests depending on Perl for textconv scripts t: refactor tests depending on Perl to print data t: refactor tests depending on Perl substitution operator t: refactor tests depending on Perl transliteration operator Makefile: stop requiring Perl when running tests meson: stop requiring Perl when tests are enabled t: adapt existing PERL prerequisites t: introduce PERL_TEST_HELPERS prerequisite t: adapt `test_readlink()` to not use Perl t: adapt `test_copy_bytes()` to not use Perl t: adapt character translation helpers to not use Perl t: refactor environment sanitization to not use Perl t: skip chain lint when PERL_PATH is unset
Diffstat (limited to 't/test-lib-functions.sh')
-rw-r--r--t/test-lib-functions.sh20
1 files changed, 5 insertions, 15 deletions
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 16eaaaf4c3..bee4a2ca34 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -88,15 +88,15 @@ test_decode_color () {
}
lf_to_nul () {
- perl -pe 'y/\012/\000/'
+ tr '\012' '\000'
}
nul_to_q () {
- perl -pe 'y/\000/Q/'
+ tr '\000' 'Q'
}
q_to_nul () {
- perl -pe 'y/Q/\000/'
+ tr 'Q' '\000'
}
q_to_cr () {
@@ -1645,17 +1645,7 @@ test_match_signal () {
# Read up to "$1" bytes (or to EOF) from stdin and write them to stdout.
test_copy_bytes () {
- perl -e '
- my $len = $ARGV[1];
- while ($len > 0) {
- my $s;
- my $nread = sysread(STDIN, $s, $len);
- die "cannot read: $!" unless defined($nread);
- last unless $nread;
- print $s;
- $len -= $nread;
- }
- ' - "$1"
+ dd ibs=1 count="$1" 2>/dev/null
}
# run "$@" inside a non-git directory
@@ -1994,7 +1984,7 @@ test_remote_https_urls() {
# Print the destination of symlink(s) provided as arguments. Basically
# the same as the readlink command, but it's not available everywhere.
test_readlink () {
- perl -le 'print readlink($_) for @ARGV' "$@"
+ test-tool path-utils readlink "$@"
}
# Set mtime to a fixed "magic" timestamp in mid February 2009, before we