groff-commit
[Top][All Lists]
Advanced

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

[groff] 34/38: [mm]: Regression-test Savannah #24048.


From: G. Branden Robinson
Subject: [groff] 34/38: [mm]: Regression-test Savannah #24048.
Date: Mon, 3 Oct 2022 01:43:00 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 6c0f977d59a6d8aaa1d61e8eb709008cb312dfcb
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Oct 2 23:23:18 2022 -0500

    [mm]: Regression-test Savannah #24048.
    
    * contrib/mm/tests/short-pages-do-not-overflow-stack.sh: Test it.
    * contrib/mm/mm.am (mm_TESTS): Run test.
    
    Test fails at this commit.
---
 contrib/mm/ChangeLog                               |  7 +++
 contrib/mm/mm.am                                   |  3 +-
 .../mm/tests/short-pages-do-not-overflow-stack.sh  | 59 ++++++++++++++++++++++
 3 files changed, 68 insertions(+), 1 deletion(-)

diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index 315e59492..7a89321b4 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,10 @@
+2022-10-02  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       Regression-test Savannah #24048.
+
+       * tests/short-pages-do-not-overflow-stack.sh: Test it.
+       * mm.am (mm_TESTS): Run test.
+
 2022-09-17  Nikita Ivanov <nikita.vyach.ivanov@gmail.com>
 
        * mm/ms.cov (cov@print-title, cov@print-authors): Escape
diff --git a/contrib/mm/mm.am b/contrib/mm/mm.am
index ad1957605..13181d27b 100644
--- a/contrib/mm/mm.am
+++ b/contrib/mm/mm.am
@@ -66,7 +66,8 @@ mm_TESTS = \
   contrib/mm/tests/MT_5_includes_AT_in_SG.sh \
   contrib/mm/tests/ms_cover_sheet_robust_to_missing_AF.sh \
   contrib/mm/tests/place-equation-labels-correctly-in-displays.sh \
-  contrib/mm/tests/remove-stale-bib-entry-data.sh
+  contrib/mm/tests/remove-stale-bib-entry-data.sh \
+  contrib/mm/tests/short-pages-do-not-overflow-stack.sh
 TESTS += $(mm_TESTS)
 EXTRA_DIST += \
   $(mm_TESTS) \
diff --git a/contrib/mm/tests/short-pages-do-not-overflow-stack.sh 
b/contrib/mm/tests/short-pages-do-not-overflow-stack.sh
new file mode 100755
index 000000000..4be0e134e
--- /dev/null
+++ b/contrib/mm/tests/short-pages-do-not-overflow-stack.sh
@@ -0,0 +1,59 @@
+#!/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"
+
+fail=
+
+wail () {
+    echo FAILED >&2
+    fail=YES
+}
+
+# Regression-test Savannah #24048.  Pages that are too short to
+# accommodate minimal header and footer requirements should not cause
+# infinite trap recursion.
+
+input='.COVER
+.TL
+Title
+.AU "R. Thurston Howell"
+.AT "Professor of Agnotology" "Publisher, Posterior Analytics Weekly"
+.COVEND
+.P
+Main matter goes here.'
+
+echo "checking that sample document fits using default length" >&2
+output=$(printf "%s\n" "$input" \
+    | "$groff" -b -mm -Tascii -P-cbou) || wail
+
+echo "checking that sample document fits using -rL5v" >&2
+output=$(printf "%s\n" "$input" \
+    | "$groff" -b -rL5v -mm -Tascii -P-cbou) || wail
+
+echo "checking that sample document fails gracefully using -rL4v" >&2
+error=$(printf "%s\n" "$input" \
+    | "$groff" -b -rL4v -mm -Tascii -P-cbou -z 2>&1)
+# Assume that >= 10 lines of stderr must be due to a giant backtrace.
+test $(echo "$error" | wc -l) -lt 10 || wail
+
+test -z "$fail"
+
+# vim:set ai et sw=4 ts=4 tw=72:



reply via email to

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