groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 06/09: [mm]: Adapt tests to feeble systems.


From: G. Branden Robinson
Subject: [groff] 06/09: [mm]: Adapt tests to feeble systems.
Date: Wed, 4 Dec 2024 09:51:22 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 0eedbde96a0f40674421e91b33adac99525b4ceb
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Dec 4 06:39:54 2024 -0600

    [mm]: Adapt tests to feeble systems.
    
    ...lacking a cksum conforming to POSIX Issue 4 (1994).
    
    * contrib/mm/tests/letters-format-correctly.sh:
    * contrib/mm/tests/memoranda-format-correctly.sh: Do it.
---
 contrib/mm/ChangeLog                           |  6 ++++++
 contrib/mm/tests/letters-format-correctly.sh   | 10 ++++++++--
 contrib/mm/tests/memoranda-format-correctly.sh | 10 ++++++++--
 3 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index 647ba5116..dbf06997a 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,9 @@
+2024-12-04  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * tests/letters-format-correctly.sh:
+       * tests/memoranda-format-correctly.sh: Adapt tests to feeble
+       systems lacking a cksum conforming to POSIX Issue 4 (1994).
+
 2024-11-30  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * Makefile.sim: Rename Makefile macro `DEVICE` to
diff --git a/contrib/mm/tests/letters-format-correctly.sh 
b/contrib/mm/tests/letters-format-correctly.sh
index 28353a0af..5ff97d261 100755
--- a/contrib/mm/tests/letters-format-correctly.sh
+++ b/contrib/mm/tests/letters-format-correctly.sh
@@ -65,9 +65,15 @@ for t in BL SB FB SP
 do
     echo "checking formatting of LT type '$t'" >&2
     "$groff" -ww -m m -d lT=$t -T ascii -P -cbou "$input"
-    expected=$(cksum "$artifacts_dir"/letter.$t | cut -d' ' -f1-2)
+    # We _would_ use "cut -d' ' -f1-2" here, but Solaris 10 cksum writes
+    # tabs between fields instead of spaces, nonconformantly with POSIX
+    # Issue 4 (1994); see XCU p. 195, PDF p. 217.  Quality!  So fire up
+    # big old AWK instead.  We're sure to be running on "enterprise"
+    # hardware with that fancy proprietary OS.
+    expected=$(cksum "$artifacts_dir"/letter.$t \
+        | awk '{ print $1, $2 }')
     actual=$("$groff" -ww -mm -dlT=$t -Tascii -P-cbou "$input" | cksum \
-        | cut -d' ' -f1-2)
+        | awk '{ print $1, $2 }')
     test "$actual" = "$expected" || wail
 done
 
diff --git a/contrib/mm/tests/memoranda-format-correctly.sh 
b/contrib/mm/tests/memoranda-format-correctly.sh
index 592797242..fbb38f10a 100755
--- a/contrib/mm/tests/memoranda-format-correctly.sh
+++ b/contrib/mm/tests/memoranda-format-correctly.sh
@@ -67,9 +67,15 @@ for t in 0 1 2 3 4 5 custom
 do
     echo "checking formatting of MT type '$t'" >&2
     "$groff" -ww -m m -d mT=$t -T ascii -P -cbou "$input"
-    expected=$(cksum "$artifacts_dir"/memorandum.$t | cut -d' ' -f1-2)
+    # We _would_ use "cut -d' ' -f1-2" here, but Solaris 10 cksum writes
+    # tabs between fields instead of spaces, nonconformantly with POSIX
+    # Issue 4 (1994); see XCU p. 195, PDF p. 217.  Quality!  So fire up
+    # big old AWK instead.  We're sure to be running on "enterprise"
+    # hardware with that fancy proprietary OS.
+    expected=$(cksum "$artifacts_dir"/memorandum.$t \
+        | awk '{ print $1, $2 }')
     actual=$("$groff" -mm -dmT=$t -Tascii -P-cbou "$input" | cksum \
-        | cut -d' ' -f1-2)
+        | awk '{ print $1, $2 }')
     test "$actual" = "$expected" || wail
 done
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]