On 11/04/2022 15:44, Pádraig Brady wrote:
On 10/04/2022 21:59, Bruno Haible wrote:
On Cygwin 2.9.0 (x86_64) there are 35 failures:
Honestly I think "windows subsystem for linux" is a more practical target than
cygwin.
So 'm not going to try and get a clean run on cygwin.
Though we should address things where obvious / easy.
The attached should fix the issue for b2sum.sh at least.
Updated patch attached to fix all md5sum issues.
cheers,
Pádraig
From c630cd0f9bb338404a651e60e7238858dcd6d57d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <p...@draigbrady.com>
Date: Mon, 11 Apr 2022 15:37:04 +0100
Subject: [PATCH] tests: md5sum: fix false failures on cygwin
* tests/misc/b2sum.sh: Avoid binary '*' tags when comparing ccksums.
* tests/misc/md5sum-newline.pl: Likewise.
* tests/misc/md5sum-bsd.sh: Avoid binary '*' tags so that we correctly
trigger the ambiguity test.
Reported by Bruno Haible
---
tests/misc/b2sum.sh | 6 ++++--
tests/misc/md5sum-bsd.sh | 2 +-
tests/misc/md5sum-newline.pl | 2 +-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/tests/misc/b2sum.sh b/tests/misc/b2sum.sh
index 1602aec89..30897021d 100755
--- a/tests/misc/b2sum.sh
+++ b/tests/misc/b2sum.sh
@@ -41,8 +41,9 @@ $prog --strict -c openssl.b2sum || fail=1
rm -f check.vals || framework_failure_
# Ensure we can check non tagged format
[ "$prog" != 'b2sum' ] && tag_opt='--untagged' || tag_opt=''
+[ "$prog" == 'b2sum' ] && text_opt='--text' || text_opt=''
for l in 0 128; do
- $prog $tag_opt -l $l /dev/null | tee -a check.vals > check.b2sum
+ $prog $tag_opt $text_opt -l $l /dev/null | tee -a check.vals > check.b2sum
$prog -l $l --strict -c check.b2sum || fail=1
$prog --strict -c check.b2sum || fail=1
done
@@ -50,7 +51,8 @@ done
# Ensure the checksum values are correct. The reference
# check.vals was created with the upstream SSE reference implementation.
[ "$prog" != 'b2sum' ] && tag_opt='--untagged' || tag_opt=''
-$prog $tag_opt --length=128 check.vals > out || fail=1
+$prog $tag_opt --length=128 check.vals > out.tmp || fail=1
+tr '*' ' ' < out.tmp > out || framework_failure_ # Remove binary tag on cygwin
printf '%s\n' '796485dd32fe9b754ea5fd6c721271d9 check.vals' > exp
compare exp out || fail=1
diff --git a/tests/misc/md5sum-bsd.sh b/tests/misc/md5sum-bsd.sh
index 8ff4a9a71..57188e863 100755
--- a/tests/misc/md5sum-bsd.sh
+++ b/tests/misc/md5sum-bsd.sh
@@ -28,7 +28,7 @@ print_ver_ md5sum
# I.e., one not starting with ' ' or '*'
for i in 'a' ' b' '*c' 'dd' ' '; do
echo "$i" > "$i"
- md5sum "$i" >> check.md5sum || fail=1
+ md5sum --text "$i" >> check.md5sum || fail=1
done
sed 's/ / /' check.md5sum > check.md5
diff --git a/tests/misc/md5sum-newline.pl b/tests/misc/md5sum-newline.pl
index 4997c2198..a89b3ca7c 100755
--- a/tests/misc/md5sum-newline.pl
+++ b/tests/misc/md5sum-newline.pl
@@ -35,7 +35,7 @@ my $z = '--zero';
my @Tests =
(
['newline', $t, {IN=> {"a\nb"=> ''}}, {OUT=>"\\$degenerate a\\nb\n"}],
- ['zero', $z, {IN=> {"a\nb"=> ''}}, {OUT=>"$degenerate a\nb\0"}],
+ ['zero', "$t $z", {IN=> {"a\nb"=> ''}}, {OUT=>"$degenerate a\nb\0"}],
);
my $save_temps = $ENV{DEBUG};
--
2.26.2