groff-commit
[Top][All Lists]
Advanced

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

[groff] 02/02: [man]: Improve portability of a test.


From: G. Branden Robinson
Subject: [groff] 02/02: [man]: Improve portability of a test.
Date: Mon, 20 Feb 2023 15:30:18 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit d015cb475e7898d86a02ed258bada5b25fe81326
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon Feb 20 13:32:53 2023 -0600

    [man]: Improve portability of a test.
    
    * tmac/tests/an_TS-do-not-keep-tables-when-cR-set.sh: Improve
      portability of script by using shell constructs instead of the
      nonstandard GNU coreutils 'seq' utility.  Resolves test failure on
      Solaris 10.
    
    * HACKING: Document this problem.
---
 ChangeLog                                          | 8 ++++++++
 HACKING                                            | 9 +++++++++
 tmac/tests/an_TS-do-not-keep-tables-when-cR-set.sh | 4 ++--
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index df4532853..2ad0b5616 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2023-02-20  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * tmac/tests/an_TS-do-not-keep-tables-when-cR-set.sh: Improve
+       portability of script by using shell constructs instead of the
+       nonstandard GNU coreutils 'seq' utility.  Resolves test failure
+       on Solaris 10.
+       * HACKING: Document this problem.
+
 2023-02-20  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * m4/groff.m4 (GROFF_MAKE_DEFINES_RM): Test the make(1) in the
diff --git a/HACKING b/HACKING
index 2bf6835f1..b0e78e679 100644
--- a/HACKING
+++ b/HACKING
@@ -83,6 +83,15 @@ Here are some portability notes on writing automated tests.
   available at the Open Group's web site.
     https://pubs.opengroup.org/onlinepubs/009656399/toc.pdf
 
+* The GNU coreutils "seq" command is handy but not standardized by
+  POSIX.  Replace it with a while loop.
+
+    seq 53
+    n=1; while [ $n -le 53 ]; do echo $n; n=$(( n + 1 )); done
+
+  "unset" is supported by POSIX-conformant shell; use it to remove
+  temporary shell variables after use.
+
 * The "od" command on macOS can put extra space characters (i.e., spaces
   that don't correspond to the input) at the ends of lines when using
   the "od -t c" format; GNU od does not.
diff --git a/tmac/tests/an_TS-do-not-keep-tables-when-cR-set.sh 
b/tmac/tests/an_TS-do-not-keep-tables-when-cR-set.sh
index b39249456..3c30cd48d 100755
--- a/tmac/tests/an_TS-do-not-keep-tables-when-cR-set.sh
+++ b/tmac/tests/an_TS-do-not-keep-tables-when-cR-set.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (C) 2020 Free Software Foundation, Inc.
+# Copyright (C) 2020-2023 Free Software Foundation, Inc.
 #
 # This file is part of groff.
 #
@@ -42,7 +42,7 @@ is set.
 .
 .TS
 l.
-'$(seq 53)'
+'$(n=1; while [ $n -le 53 ]; do echo $n; n=$(( n + 1 )); done)'
 .TE'
 
 OUTPUT=$(printf "%s\n" "$EXAMPLE" | "$groff" -Tascii -P-cbou -t -man)



reply via email to

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