groff-commit
[Top][All Lists]
Advanced

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

[groff] 05/07: Add test for output driver -C -and -G options.


From: G. Branden Robinson
Subject: [groff] 05/07: Add test for output driver -C -and -G options.
Date: Sat, 22 May 2021 09:14:46 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 1167f2f14fd2ae07867edb3a513710d21727074c
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat May 22 20:15:14 2021 +1000

    Add test for output driver -C -and -G options.
    
    * src/roff/groff/tests/output_driver_C_and_G_options_work.sh: Add
      regression test for *grohtml.
    * tmac/tmac.am (groff_TESTS): Run test.
    
    Test fails at this commit.
---
 ChangeLog                                          |  6 +++
 src/roff/groff/groff.am                            |  1 +
 .../tests/output_driver_C_and_G_options_work.sh    | 50 ++++++++++++++++++++++
 3 files changed, 57 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index c7262d4..9cdb6e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2021-05-22  G. Branden Robinson <g.branden.robinson@gmail.com>
 
+       * src/roff/groff/tests/output_driver_C_and_G_options_work.sh:
+       Add regression test for *grohtml.
+       * tmac/tmac.am (groff_TESTS): Run test.
+
+2021-05-22  G. Branden Robinson <g.branden.robinson@gmail.com>
+
        * src/preproc/html/pre-html.cpp (usage):
        * src/devices/grohtml/post-html.cpp (usage): Fix inaccuracies in
        supported option summary.
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index faf8406..e0d49a0 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -48,6 +48,7 @@ groff_TESTS = \
   src/roff/groff/tests/localization_works.sh \
   src/roff/groff/tests/msoquiet_works.sh \
   src/roff/groff/tests/on_latin1_device_oq_is_0x27.sh \
+  src/roff/groff/tests/output_driver_C_and_G_options_work.sh \
   src/roff/groff/tests/recognize_end_of_sentence.sh \
   src/roff/groff/tests/regression_savannah_56555.sh \
   src/roff/groff/tests/regression_savannah_58153.sh \
diff --git a/src/roff/groff/tests/output_driver_C_and_G_options_work.sh 
b/src/roff/groff/tests/output_driver_C_and_G_options_work.sh
new file mode 100755
index 0000000..2bb1cc3
--- /dev/null
+++ b/src/roff/groff/tests/output_driver_C_and_G_options_work.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+#
+# Copyright (C) 2021 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"
+
+# Feed groff empty input documents and verify that expected comments
+# emerge from the output drivers.
+
+# Expect Creator: and CreationDate: comments.
+echo "testing presence of Creator: comment in HTML output" >&2
+echo | "$groff" -Thtml | grep -Fq '<!-- Creator:'
+
+echo "testing presence of CreationDate: comment in HTML output" >&2
+echo | "$groff" -Thtml | grep -Fq '<!-- CreationDate:'
+
+# Make sure the options are recognized so we can distinguish a match
+# failure.  We can't use -Z or -z because they keep the output driver
+# from running at all.
+for OPT in -C -G
+do
+    if ! echo | "$groff" -Thtml -P$OPT > /dev/null
+    then
+        echo "option $OPT not recognized!" >&2
+        exit 2
+    fi
+done
+
+# Now shut them off.
+echo "testing absence of Creator: comment in HTML output" >&2
+! echo | "$groff" -Thtml -P-G | grep -Fq '<!-- Creator:'
+
+echo "testing absence of CreationDate: comment in HTML output" >&2
+! echo | "$groff" -Thtml -P-C | grep -Fq '<!-- CreationDate:'



reply via email to

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