1
0
mirror of https://git.savannah.gnu.org/git/coreutils.git synced 2026-10-24 02:08:57 +03:00

tests: sum,cp: disable Unicode when executing Perl

* tests/local.mk (TESTS_ENVIRONMENT): Set PERL_UNICODE to 0.
* tests/cksum/sum-sysv.sh: Call binmode on STDOUT.
* tests/cp/copy-FMR.sh: Likewise.
* tests/cp/sparse-extents-2.sh: Likewise.
Fixes https://bugs.gnu.org/81994
This commit is contained in:
Collin Funk
2026-10-04 22:55:08 -07:00
parent e6c09ec0b1
commit a0cec995fa
4 changed files with 7 additions and 4 deletions

View File

@@ -30,7 +30,8 @@ require_perl_
# FYI, 16843009 is floor (2^32 / 255).
# aka: perl -e 'print chr(255) x 16843009'
$PERL -e '$s = chr(255) x 65537; foreach (1..257) {print $s}' \
$PERL -e 'binmode STDOUT;
$s = chr(255) x 65537; foreach (1..257) {print $s}' \
| sum -s > out || fail=1
cat > exp <<\EOF
65535 32897
@@ -40,7 +41,8 @@ compare exp out || fail=1
rm -f out exp
# aka: perl -e 'print chr(255) x 16843010'
$PERL -e '$s = chr(255) x 65537; foreach (1..257) {print $s}; print chr(255)' \
$PERL -e 'binmode STDOUT;
$s = chr(255) x 65537; foreach (1..257) {print $s}; print chr(255)' \
| sum -s > out || fail=1
cat > exp <<\EOF
254 32897

View File

@@ -23,7 +23,7 @@ require_valgrind_
require_perl_
# Trigger FMR in fiemap logic from v8.11..v8.19
$PERL -e 'for (1..600) { sysseek (*STDOUT, 4096, 1)' \
$PERL -e 'binmode STDOUT; for (1..600) { sysseek (*STDOUT, 4096, 1)' \
-e '&& syswrite (*STDOUT, "a" x 1024) or die "$!"}' > j || fail=1
valgrind --quiet --error-exitcode=3 cp --reflink=never j j2 || fail=1
cmp j j2 || fail=1

View File

@@ -68,7 +68,7 @@ f()
for i in $(seq 1 2 21); do
for j in 1 2 31 100; do
$PERL -e '$n = '$i' * 1024; *F = *STDOUT;' \
$PERL -e 'binmode STDOUT; $n = '$i' * 1024; *F = *STDOUT;' \
-e 'for (1..'$j') { sysseek (*F, $n, 1)' \
-e '&& syswrite (*F, chr($_)x$n) or die "$!"}' > j1 || fail=1

View File

@@ -79,6 +79,7 @@ TESTS_ENVIRONMENT = \
MAKE=$(MAKE) \
PACKAGE_VERSION=$(PACKAGE_VERSION) \
PERL='$(PERL)' \
PERL_UNICODE=0 \
SHELL='$(PREFERABLY_POSIX_SHELL)' \
; test -d /usr/xpg4/bin && PATH='/usr/xpg4/bin$(PATH_SEPARATOR)'"$$PATH"; \
PATH='$(abs_top_builddir)/src$(PATH_SEPARATOR)'"$$PATH" \