gbranden pushed a commit to branch master
in repository groff.
commit 0d2e4760732181ffad8ddeee68db5a3d2710980f
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Dec 20 20:30:07 2025 -0600
[groff]: Add smoke test for "pdf" device.
* src/roff/groff/tests/pdf-device-smoke-test.sh: New file.
* src/roff/groff/groff.am (groff_TESTS): Run test.
---
ChangeLog | 5 ++++
src/roff/groff/groff.am | 1 +
src/roff/groff/tests/pdf-device-smoke-test.sh | 33 +++++++++++++++++++++++++++
3 files changed, 39 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 771ddaccc..c8ab8598e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2025-12-20 G. Branden Robinson <[email protected]>
+
+ * src/roff/groff/tests/pdf-device-smoke-test.sh: New file.
+ * src/roff/groff/groff.am (groff_TESTS): Run test.
+
2025-12-20 G. Branden Robinson <[email protected]>
* src/roff/groff/tests/lj4-device-smoke-test.sh: New file.
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index 0bf6f42cf..ecf98433e 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -102,6 +102,7 @@ groff_TESTS = \
src/roff/groff/tests/msoquiet-request-works.sh \
src/roff/groff/tests/output-request-works.sh \
src/roff/groff/tests/pchar-request-works.sh \
+ src/roff/groff/tests/pdf-device-smoke-test.sh \
src/roff/groff/tests/pi-request-works.sh \
src/roff/groff/tests/ps-device-smoke-test.sh \
src/roff/groff/tests/recognize-end-of-sentence.sh \
diff --git a/src/roff/groff/tests/pdf-device-smoke-test.sh
b/src/roff/groff/tests/pdf-device-smoke-test.sh
new file mode 100755
index 000000000..4330c9ec3
--- /dev/null
+++ b/src/roff/groff/tests/pdf-device-smoke-test.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# Copyright 2025 G. Branden Robinson
+#
+# This file is part of groff, the GNU roff typesetting system.
+#
+# 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"
+
+# Expected output:
+#0000460 H e l l o , nl q sp B T nl 1 sp 0 sp
+#0001020 H 1 0 6 3 4 0 nl % sp t o r l d !
+
+# '-P -d' because we want the PDF uncompressed for pattern matching.
+output=$(echo "Hello, world!" | "$groff" -T pdf -P -d | od -t a)
+echo "$output" | grep '^0000460'
+echo "$output" | grep '^0001020'
+echo "$output" | grep -Eq '^0000460.*H +e +l +l +o +,' || exit 1
+echo "$output" | grep -Eq '^0001020.*o +r +l +d +!' || exit 1
+
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit