groff-commit
[Top][All Lists]
Advanced

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

[groff] 01/03: Add regression test for usable in-tree mdoc.


From: G. Branden Robinson
Subject: [groff] 01/03: Add regression test for usable in-tree mdoc.
Date: Tue, 25 Aug 2020 04:34:29 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 866be4c6b54e03b91a7e170cce2e1a09a6297fb4
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Aug 25 07:07:32 2020 +1000

    Add regression test for usable in-tree mdoc.
    
    * tmac/tests/doc-smoke-test.sh: Add test.
    * tmac/tmac.am (tmac_TESTS): Run test.
    
    Test fails now, will pass in next commit.
---
 ChangeLog                    |  7 +++++
 tmac/tests/doc-smoke-test.sh | 73 ++++++++++++++++++++++++++++++++++++++++++++
 tmac/tmac.am                 |  3 +-
 3 files changed, 82 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index bb89153..379f0ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2020-08-25  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       Add regression test for usable in-tree mdoc.
+
+       * tmac/tests/doc-smoke-test.sh: Add test.
+       * tmac/tmac.am (tmac_TESTS): Run test.
+
 2020-08-22  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * tmac/tests/an-old_TH_repairs_ad_damage.sh:
diff --git a/tmac/tests/doc-smoke-test.sh b/tmac/tests/doc-smoke-test.sh
new file mode 100755
index 0000000..607c770
--- /dev/null
+++ b/tmac/tests/doc-smoke-test.sh
@@ -0,0 +1,73 @@
+#!/bin/sh
+#
+# Copyright (C) 2020 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"
+
+# Regression-test Savannah #51003.
+#
+# Ensure we can render mdoc man pages from a build tree.
+
+EXAMPLE='\
+.Dd August 25, 2020
+.Dt mdoc\-test 7
+.Os
+.Sh NAME \" It REALLY DOES need to be in full caps.
+.Nm mdoc\-test
+.Nd a smoke test for groff'"'"'s mdoc implementation
+.Sh Description
+If you can read this without a hailstorm of warnings,
+things are probably working.'
+
+OUTPUT=$(printf "%s\n" "$EXAMPLE" | "$groff" -Tascii -P-cbou -mdoc)
+FAIL=
+
+if ! echo "$OUTPUT" | grep -qE '^mdoc-test\(7\) +BSD Miscellaneous'
+then
+    FAIL=yes
+    echo "header check failed" >&2
+fi
+
+if ! echo "$OUTPUT" | grep -qE '^NAME$'
+then
+    FAIL=yes
+    echo "\"NAME\" section heading missing" >&2
+fi
+
+if ! echo "$OUTPUT" | grep -qE '^Description$'
+then
+    FAIL=yes
+    echo "\"Description\" section heading missing" >&2
+fi
+
+if ! echo "$OUTPUT" | grep -qE 'you can read this'
+then
+    FAIL=yes
+    echo "paragraph body check failed" >&2
+fi
+
+if ! echo "$OUTPUT" | grep -qE '^BSD +August 25, 2020'
+then
+    FAIL=yes
+    echo "footer check failed" >&2
+fi
+
+test -z "$FAIL"
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/tmac/tmac.am b/tmac/tmac.am
index 2e77160..3da6e84 100644
--- a/tmac/tmac.am
+++ b/tmac/tmac.am
@@ -153,7 +153,8 @@ tmac_TESTS = \
   tmac/tests/an-old_CT_register_on.sh \
   tmac/tests/an-old_CT_register_unspecified.sh \
   tmac/tests/an-old_TH_repairs_ad_damage.sh \
-  tmac/tests/an-old_TH_repairs_hy_damage.sh
+  tmac/tests/an-old_TH_repairs_hy_damage.sh \
+  tmac/tests/doc-smoke-test.sh
 TESTS += $(tmac_TESTS)
 
 tmac_XFAIL_TESTS = \



reply via email to

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