groff-commit
[Top][All Lists]
Advanced

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

[groff] 01/02: [mom]: Always generate test script.


From: G. Branden Robinson
Subject: [groff] 01/02: [mom]: Always generate test script.
Date: Fri, 3 Mar 2023 09:58:46 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 1ec02e805e2448bb17a27e3d9398cc83fd272743
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Mar 1 06:06:47 2023 -0600

    [mom]: Always generate test script.
    
    [mom]: Generate test script even if we'll skip it.
    
    * contrib/mom/examples/test-mom.sh.in: Check availability of required
      pdfinfo(1) and pdfimages(1) commands at test time; skip if they aren't
      present.
    
    * contrib/mom/mom.am [!HAVE_PDFTOOLS]: Generate the test script even if
      these tools aren't available.
    
    This approach also has the slight advantage that if you build groff,
    then install these tools after building (or even testing), you can
    simply run the tests again with "make check" without having to "make
    distclean" and start all over.
    
    As a developer, I find it confusing when the (total) quantity of test
    scripts bounces around from one host environment to another.
---
 ChangeLog                           | 10 ++++++++++
 contrib/mom/examples/test-mom.sh.in |  9 +++++++++
 contrib/mom/mom.am                  |  4 +---
 3 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7718b99b5..f59415081 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2023-03-01  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [mom]: Generate test script even if we'll skip it.
+
+       * contrib/mom/examples/test-mom.sh.in: Check availability of
+       required pdfinfo(1) and pdfimages(1) commands at test time; skip
+       if they aren't present.
+       * contrib/mom/mom.am [!HAVE_PDFTOOLS]: Generate the test script
+       even if these tools aren't available.
+
 2023-03-01  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * m4/groff.m4 (GROFF_URW_FONTS_NOTICE): Adapt wording of notice
diff --git a/contrib/mom/examples/test-mom.sh.in 
b/contrib/mom/examples/test-mom.sh.in
index c9ef934ea..ebaba2082 100644
--- a/contrib/mom/examples/test-mom.sh.in
+++ b/contrib/mom/examples/test-mom.sh.in
@@ -38,6 +38,15 @@ if test "$have_urw_fonts" != "yes"; then
     exit 77
 fi
 
+for cmd in pdfinfo pdfimages
+do
+    if ! command -v $cmd >/dev/null
+    then
+        echo "cannot locate '$cmd' command; skipping" >&2
+        exit 77 # skip
+    fi
+done
+
 # $1: pdf file
 # $2: expected number of pages
 check_number_pages()
diff --git a/contrib/mom/mom.am b/contrib/mom/mom.am
index 461203457..3bbbc9ae8 100644
--- a/contrib/mom/mom.am
+++ b/contrib/mom/mom.am
@@ -103,10 +103,10 @@ MOMPROCESSEDEXAMPLEFILES += 
contrib/mom/examples/typesetting.pdf
 endif
 momprocessedexampledir = $(exampledir)/mom
 nodist_momprocessedexample_DATA = $(MOMPROCESSEDEXAMPLEFILES)
+endif
 
 mom_test_template = contrib/mom/examples/test-mom.sh.in
 
-if HAVE_PDFTOOLS
 # Small test suite on mom examples
 mom_TESTS = contrib/mom/examples/tests-mom.sh
 TESTS += $(mom_TESTS)
@@ -120,8 +120,6 @@ contrib/mom/examples/tests-mom.sh: \
          $(top_srcdir)/$(mom_test_template) > $@ \
        && chmod +x $@
 MOSTLYCLEANFILES += $(mom_TESTS)
-endif
-endif
 EXTRA_DIST += $(mom_test_template)
 
 # For this list of files we add a symlink from $(exampledir)/mom to 
$(pdfdocdir)



reply via email to

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