groff-commit
[Top][All Lists]
Advanced

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

[groff] 05/07: [pdfpic]: Regression-test Savannah #58206.


From: G. Branden Robinson
Subject: [groff] 05/07: [pdfpic]: Regression-test Savannah #58206.
Date: Fri, 21 Jan 2022 04:48:28 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 3f094e31225d0a22b250afedf4ee13f3902bd691
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Jan 21 20:27:42 2022 +1100

    [pdfpic]: Regression-test Savannah #58206.
    
    * tmac/tests/pdfpic_does-not-choke-on-bad-pdfinfo-output.sh: Do it.
    * tmac/tmac.am (tmac_TESTS): Run test.
    
    Test fails at this commit.
---
 ChangeLog                                          |  8 +++
 .../pdfpic_does-not-choke-on-bad-pdfinfo-output.sh | 63 ++++++++++++++++++++++
 tmac/tmac.am                                       |  1 +
 3 files changed, 72 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 91af01f0..76d54986 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-01-21  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [pdfpic]: Regression-test Savannah #58206.
+
+       * tmac/tests/pdfpic_does-not-choke-on-bad-pdfinfo-output.sh: Do
+       it.
+       * tmac/tmac.am (tmac_TESTS): Run test.
+
 2022-01-21  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [pdfpic]: Refactor.
diff --git a/tmac/tests/pdfpic_does-not-choke-on-bad-pdfinfo-output.sh 
b/tmac/tests/pdfpic_does-not-choke-on-bad-pdfinfo-output.sh
new file mode 100755
index 00000000..02cdb3bb
--- /dev/null
+++ b/tmac/tests/pdfpic_does-not-choke-on-bad-pdfinfo-output.sh
@@ -0,0 +1,63 @@
+#!/bin/sh
+#
+# Copyright (C) 2022 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+gnu_eps="${abs_top_builddir:-.}/gnu.eps"
+gnu_pdf="${abs_top_builddir:-.}/gnu.pdf"
+
+# Regression-test Savannah #58206.
+
+if ! command -v gs >/dev/null
+then
+    echo "cannot locate 'gs' command"
+    exit 77 # skip
+fi
+
+if [ -e "$gnu_pdf" ]
+then
+    echo "temporary output file gnu.pdf already exists"
+    exit 77 # skip
+fi
+
+fail=
+
+input='
+.am pdfpic@error
+.  ab
+..
+Here is a picture of a wildebeest.
+.PDFPIC '"$gnu_pdf"'
+'
+
+if ! gs -o - -sDEVICE=pdfwrite -f "$gnu_eps" \
+    -c "[ /Title (\000B\000U\000S\000T\000E\000D) /DOCINFO pdfmark" \
+    > "$gnu_pdf"
+then
+    echo "gs command failed" >&2
+    fail=YES
+fi
+
+test -z $fail && \
+    printf '%s\n' "$input" | "$groff" -Tpdf -U -z || fail=YES
+
+rm -f "$gnu_pdf"
+test -z $fail
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/tmac/tmac.am b/tmac/tmac.am
index 28dfc96e..d02a8a76 100644
--- a/tmac/tmac.am
+++ b/tmac/tmac.am
@@ -190,6 +190,7 @@ tmac_TESTS = \
   tmac/tests/e_footnotes-work-with-columns.sh \
   tmac/tests/e_ld-works.sh \
   tmac/tests/e_line-numbering-works.sh \
+  tmac/tests/pdfpic_does-not-choke-on-bad-pdfinfo-output.sh \
   tmac/tests/localization-works.sh \
   tmac/tests/s_IP-indents-using-paragraph-type-size.sh \
   tmac/tests/s_IP-respects-inter-sentence-space-in-tags.sh \



reply via email to

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