From 1ec02e805e2448bb17a27e3d9398cc83fd272743 Mon Sep 17 00:00:00 2001 From: "G. Branden Robinson" Date: Wed, 1 Mar 2023 06:06:47 -0600 Subject: [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. --- contrib/mom/examples/test-mom.sh.in | 9 +++++++++ contrib/mom/mom.am | 4 +--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'contrib') 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) -- cgit v1.2.1