diff options
author | G. Branden Robinson <g.branden.robinson@gmail.com> | 2023-03-01 06:06:47 -0600 |
---|---|---|
committer | G. Branden Robinson <g.branden.robinson@gmail.com> | 2023-03-02 04:19:43 -0600 |
commit | 1ec02e805e2448bb17a27e3d9398cc83fd272743 (patch) | |
tree | 7996c15be1bf37890389f0827f9ae6bc761ac210 /contrib | |
parent | 5a420e557b61146341c025f45998abc971fe346d (diff) | |
download | groff-git-1ec02e805e2448bb17a27e3d9398cc83fd272743.tar.gz |
[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.
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/mom/examples/test-mom.sh.in | 9 | ||||
-rw-r--r-- | contrib/mom/mom.am | 4 |
2 files changed, 10 insertions, 3 deletions
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) |