From 5486b5bc09f394d2697e32e2f2b887eea93f4b14 Mon Sep 17 00:00:00 2001 From: "G. Branden Robinson" Date: Tue, 21 Feb 2023 16:43:10 -0600 Subject: [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 (1/2). --- 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 +++++++++++ 3 files changed, 24 insertions(+), 4 deletions(-) (limited to 'src') 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 () { -- cgit v1.2.1