groff-commit
[Top][All Lists]
Advanced

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

[groff] 07/23: [grohtml]: Fix Savannah #63824 (1/2).


From: G. Branden Robinson
Subject: [groff] 07/23: [grohtml]: Fix Savannah #63824 (1/2).
Date: Thu, 23 Feb 2023 11:10:23 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 5486b5bc09f394d2697e32e2f2b887eea93f4b14
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Feb 21 16:43:10 2023 -0600

    [grohtml]: Fix Savannah #63824 (1/2).
    
    [grohtml]: Revise tests to check for requisite programs at test time and
    skip if not found, rather than configuring them away at build time,
    which can cause a distribution archive to be incorrectly structured.
    
    * m4/groff.m4: Annotate requisite program list since we're violating the
      DRY principle.
    
    * src/roff/groff/groff.am (groff_TESTS): Populate unconditionally.
    
    * src/roff/groff/tests/html_works_with_grn_and_eqn.sh:
    * src/roff/groff/tests/smoke-test_html_device.sh: Check for requisite
      programs and skip test if any are not found.
    
    Fixes <https://savannah.gnu.org/bugs/?63824> (1/2).
---
 ChangeLog                                           | 18 ++++++++++++++++++
 m4/groff.m4                                         |  1 +
 src/roff/groff/groff.am                             |  6 ++----
 src/roff/groff/tests/html_works_with_grn_and_eqn.sh | 11 +++++++++++
 src/roff/groff/tests/smoke-test_html_device.sh      | 11 +++++++++++
 5 files changed, 43 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7a7bb4a73..ebd9bf6e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2023-02-21  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [grohtml]: Revise tests to check for requisite programs at test
+       time and skip if not found, rather than configuring them away at
+       build time, which can cause a distribution archive to be
+       incorrectly structured.
+
+       * m4/groff.m4: Annotate requisite program list since we're
+       violating the DRY principle.
+       * src/roff/groff/groff.am (groff_TESTS): Populate
+       unconditionally.
+
+       * src/roff/groff/tests/html_works_with_grn_and_eqn.sh:
+       * src/roff/groff/tests/smoke-test_html_device.sh: Check for
+       requisite programs and skip test if any are not found.
+
+       Fixes <https://savannah.gnu.org/bugs/?63824> (1/2).
+
 2023-02-21  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [man pages]: Define page-local `MR` fallback.
diff --git a/m4/groff.m4 b/m4/groff.m4
index 7bb4466a7..af2ddfdcd 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -182,6 +182,7 @@ AC_DEFUN([GROFF_CHECK_GROHTML_PROGRAMS], [
   make_htmldoc=no
   missing=
   m4_foreach([groff_prog],
+dnl Keep this list of programs in sync with grohtml test scripts.
     [[pnmcrop], [pnmcut], [pnmtopng], [pnmtops], [psselect]], [
       AC_CHECK_PROG(groff_prog, groff_prog, [found], [missing])
       if test $[]groff_prog = missing
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index 82cb03760..8937d4ced 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -47,6 +47,7 @@ groff_TESTS = \
   src/roff/groff/tests/evc_produces_no_output_if_invalid.sh \
   src/roff/groff/tests/fp_should_not_traverse_directories.sh \
   src/roff/groff/tests/handle_special_input_code_points.sh \
+  src/roff/groff/tests/html_works_with_grn_and_eqn.sh \
   src/roff/groff/tests/initialization_is_quiet.sh \
   src/roff/groff/tests/localization_works.sh \
   src/roff/groff/tests/msoquiet_works.sh \
@@ -58,6 +59,7 @@ groff_TESTS = \
   src/roff/groff/tests/regression_savannah_58162.sh \
   src/roff/groff/tests/regression_savannah_58337.sh \
   src/roff/groff/tests/regression_savannah_59202.sh \
+  src/roff/groff/tests/smoke-test_html_device.sh \
   src/roff/groff/tests/some_escapes_accept_newline_delimiters.sh \
   src/roff/groff/tests/soquiet_works.sh \
   src/roff/groff/tests/string_case_xform_errors.sh \
@@ -65,10 +67,6 @@ groff_TESTS = \
   src/roff/groff/tests/string_case_xform_unicode_escape.sh \
   src/roff/groff/tests/substring_works.sh \
   src/roff/groff/tests/use_point_size_escape_with_single_digit_arg.sh
-if USE_GROHTML
-groff_TESTS += src/roff/groff/tests/html_works_with_grn_and_eqn.sh \
-  src/roff/groff/tests/smoke-test_html_device.sh
-endif
 TESTS += $(groff_TESTS)
 EXTRA_DIST += $(groff_TESTS)
 
diff --git a/src/roff/groff/tests/html_works_with_grn_and_eqn.sh 
b/src/roff/groff/tests/html_works_with_grn_and_eqn.sh
index 972331c77..e0709440f 100755
--- a/src/roff/groff/tests/html_works_with_grn_and_eqn.sh
+++ b/src/roff/groff/tests/html_works_with_grn_and_eqn.sh
@@ -20,6 +20,17 @@
 
 groff="${abs_top_builddir:-.}/test-groff"
 
+# Keep this list of programs in sync with GROFF_CHECK_GROHTML_PROGRAMS
+# in m4/groff.m4.
+for cmd in pnmcrop pnmcut pnmtopng pnmtops psselect
+do
+    if ! command -v $cmd >/dev/null
+    then
+        echo "cannot locate '$cmd' command; skipping test" >&2
+        exit 77 # skip
+    fi
+done
+
 # Commit c71b4ef4aa provoked an infinite loop in post-grohtml with these
 # preprocessors.
 
diff --git a/src/roff/groff/tests/smoke-test_html_device.sh 
b/src/roff/groff/tests/smoke-test_html_device.sh
index efdaa0449..877fc28fb 100755
--- a/src/roff/groff/tests/smoke-test_html_device.sh
+++ b/src/roff/groff/tests/smoke-test_html_device.sh
@@ -20,6 +20,17 @@
 
 groff="${abs_top_builddir:-.}/test-groff"
 
+# Keep this list of programs in sync with GROFF_CHECK_GROHTML_PROGRAMS
+# in m4/groff.m4.
+for cmd in pnmcrop pnmcut pnmtopng pnmtops psselect
+do
+    if ! command -v $cmd >/dev/null
+    then
+        echo "cannot locate '$cmd' command; skipping test" >&2
+        exit 77 # skip
+    fi
+done
+
 fail=
 
 wail () {



reply via email to

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