[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 07/35: [tests]: Add test for PDFPIC fallback to PSPIC.
From: |
G. Branden Robinson |
Subject: |
[groff] 07/35: [tests]: Add test for PDFPIC fallback to PSPIC. |
Date: |
Mon, 21 Feb 2022 06:15:51 -0500 (EST) |
gbranden pushed a commit to branch master
in repository groff.
commit c1da47268142b97f4683229cd5799d00be3d973e
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Feb 15 18:06:37 2022 +1100
[tests]: Add test for PDFPIC fallback to PSPIC.
* tmac/tests/pdfpic_falls_back_to_PSPIC.sh: Do it.
* tmac/tmac.am (tmac_TESTS): Run test.
Also fix lexical ordering of test script names in tmac.am.
---
ChangeLog | 7 ++++
tmac/tests/pdfpic_falls_back_to_PSPIC.sh | 57 ++++++++++++++++++++++++++++++++
tmac/tmac.am | 3 +-
3 files changed, 66 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 0ad171f2..582f1b04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-02-15 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ [tests]: Add test for PDFPIC fallback to PSPIC.
+
+ * tmac/tests/pdfpic_falls_back_to_PSPIC.sh: Do it.
+ * tmac/tmac.am (tmac_TESTS): Run test.
+
2022-02-15 G. Branden Robinson <g.branden.robinson@gmail.com>
[tests]: Tweak PDFPIC test input.
diff --git a/tmac/tests/pdfpic_falls_back_to_PSPIC.sh
b/tmac/tests/pdfpic_falls_back_to_PSPIC.sh
new file mode 100755
index 00000000..8082a309
--- /dev/null
+++ b/tmac/tests/pdfpic_falls_back_to_PSPIC.sh
@@ -0,0 +1,57 @@
+#!/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-fallback-pspic.pdf"
+gnu_fallback_eps="${abs_top_builddir:-.}/gnu-fallback-pspic.eps"
+
+if ! command -v gs >/dev/null
+then
+ echo "cannot locate 'gs' command" >&2
+ exit 77 # skip
+fi
+
+if [ -e "$gnu_pdf" ]
+then
+ echo "temporary output file '$gnu_pdf' already exists" >&2
+ exit 77 # skip
+fi
+
+fail=
+
+input='.am pdfpic@error
+. ab
+..
+Here is a picture of a wildebeest.
+.PDFPIC '"$gnu_pdf"
+
+if ! gs -q -o - -sDEVICE=pdfwrite -f "$gnu_eps" > "$gnu_pdf"
+then
+ echo "gs command failed" >&2
+ exit 77 # skip
+fi
+test -z $fail \
+ && printf '%s\n' "$input" | "$groff" -Tps -U -z || fail=YES
+
+rm -f "$gnu_pdf" "$gnu_fallback_eps"
+test -z $fail
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/tmac/tmac.am b/tmac/tmac.am
index 87929d07..56785f9a 100644
--- a/tmac/tmac.am
+++ b/tmac/tmac.am
@@ -191,8 +191,9 @@ tmac_TESTS = \
tmac/tests/e_ld-works.sh \
tmac/tests/e_line-numbering-works.sh \
tmac/tests/e_rejects-too-short-page-lengths.sh \
- tmac/tests/pdfpic_does-not-choke-on-bad-pdfinfo-output.sh \
tmac/tests/localization-works.sh \
+ tmac/tests/pdfpic_does-not-choke-on-bad-pdfinfo-output.sh \
+ tmac/tests/pdfpic_falls_back_to_PSPIC.sh \
tmac/tests/s_IP-indents-using-paragraph-type-size.sh \
tmac/tests/s_IP-respects-inter-sentence-space-in-tags.sh \
tmac/tests/s_PN-works.sh \
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 07/35: [tests]: Add test for PDFPIC fallback to PSPIC.,
G. Branden Robinson <=