gbranden pushed a commit to branch master
in repository groff.

commit 2eb2d11cedc3edcb755c7a00273e9533e9f8957d
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Oct 16 16:44:34 2026 -0500

    [groff]: Unit-test `so` request.
    
    * src/roff/groff/tests/so-request-works.sh: Do it.
    
    * src/roff/groff/tests/artifacts/sourced-file: New file.
    
    * src/roff/groff/groff.am: Update `groff_TESTS` to run test.  Update
      `EXTRA_DIST` to ship new artifact file.
---
 ChangeLog                                   |  9 +++++
 src/roff/groff/groff.am                     |  2 +
 src/roff/groff/tests/artifacts/sourced-file |  1 +
 src/roff/groff/tests/so-request-works.sh    | 59 +++++++++++++++++++++++++++++
 4 files changed, 71 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index f2be40e8d..8711166f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2026-10-16  G. Branden Robinson <[email protected]>
+
+       [groff]: Unit-test `so` request.
+
+       * src/roff/groff/tests/so-request-works.sh: New file; do it.
+       * src/roff/groff/tests/artifacts/sourced-file: New file.
+       * src/roff/groff/groff.am: Update `groff_TESTS` to run test.
+       Update `EXTRA_DIST` to ship new artifact file.
+
 2026-10-14  G. Branden Robinson <[email protected]>
 
        * m4/groff.m4 (GROFF_G): Fix logic botch; we were treating the
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index 426301912..2395106ef 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -156,6 +156,7 @@ groff_TESTS = \
   src/roff/groff/tests/set-stroke-thickness.sh \
   src/roff/groff/tests/sizes-request-works.sh \
   src/roff/groff/tests/so-request-accepts-embedded-space-in-arg.sh \
+  src/roff/groff/tests/so-request-works.sh \
   src/roff/groff/tests/soquiet-request-works.sh \
   src/roff/groff/tests/ss-request-works.sh \
   src/roff/groff/tests/stringdown-and-stringup-requests-work.sh \
@@ -182,6 +183,7 @@ EXTRA_DIST += \
   src/roff/groff/tests/artifacts/HONEYPOT \
   src/roff/groff/tests/artifacts/devascii/README \
   src/roff/groff/tests/artifacts/small-gnu-head.png \
+  src/roff/groff/tests/artifacts/sourced-file \
   src/roff/groff/tests/artifacts/throughput-file
 
 groff_XFAIL_TESTS = \
diff --git a/src/roff/groff/tests/artifacts/sourced-file 
b/src/roff/groff/tests/artifacts/sourced-file
new file mode 100644
index 000000000..676fd0936
--- /dev/null
+++ b/src/roff/groff/tests/artifacts/sourced-file
@@ -0,0 +1 @@
+incomparably corny
diff --git a/src/roff/groff/tests/so-request-works.sh 
b/src/roff/groff/tests/so-request-works.sh
new file mode 100755
index 000000000..97e3722c0
--- /dev/null
+++ b/src/roff/groff/tests/so-request-works.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# Copyright 2026 G. Branden Robinson
+#
+# This file is part of groff, the GNU roff typesetting system.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+# Locate directory containing our test artifacts.
+artifacts_dir=
+
+for buildroot in . .. ../..
+do
+    d=$buildroot/src/roff/groff/tests/artifacts
+    if [ -d "$d" ]
+    then
+        artifacts_dir=$d
+        break
+    fi
+done
+
+# If we can't find it, we can't test.
+if [ -z "$artifacts_dir" ]
+then
+    echo "cannot find test artifact directory; skipping" >&2
+    exit 77 # skip
+fi
+
+# Keep preconv from being run.
+#
+# The "unset" in Solaris /usr/xpg4/bin/sh can actually fail.
+if ! unset GROFF_ENCODING
+then
+    echo "$0: unable to clear environment; skipping" >&2
+    exit 77 # skip
+fi
+
+input='.
+.so '"$artifacts_dir"'/sourced-file
+.'
+
+output=$(echo "$input" | "$groff" -Tascii 2>&1)
+echo "$output"
+echo "$output" | grep -qx "incomparably corny"
+
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to