gbranden pushed a commit to branch master in repository groff. commit 09060903cf50ee396992889efbf1c21b145c92dd Author: G. Branden Robinson <g.branden.robin...@gmail.com> AuthorDate: Mon Mar 3 00:19:33 2025 -0600
[groff]: Regression-test Savannah #66863. * src/roff/groff/tests/cf-request-works.sh: * src/roff/groff/tests/trf-request-works.sh: Add tests. * src/roff/groff/tests/artifacts/throughput-file: Add their input artifact. * src/roff/groff/groff.am (groff_TESTS): Run tests. Tests fail at this commit. --- ChangeLog | 10 +++++ src/roff/groff/groff.am | 2 + src/roff/groff/tests/artifacts/throughput-file | 1 + src/roff/groff/tests/cf-request-works.sh | 56 ++++++++++++++++++++++++++ src/roff/groff/tests/trf-request-works.sh | 56 ++++++++++++++++++++++++++ 5 files changed, 125 insertions(+) diff --git a/ChangeLog b/ChangeLog index 59771bb49..21822139f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2025-03-02 G. Branden Robinson <g.branden.robin...@gmail.com> + + [groff]: Regression-test Savannah #66863. + + * src/roff/groff/tests/cf-request-works.sh: + * src/roff/groff/tests/trf-request-works.sh: Add tests. + * src/roff/groff/tests/artifacts/throughput-file: Add their + input artifact. + * src/roff/groff/groff.am (groff_TESTS): Run tests. + 2025-03-07 G. Branden Robinson <g.branden.robin...@gmail.com> * src/roff/troff/input.cpp (token::next): Clarify warning diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am index 747dbb672..722d22a7f 100644 --- a/src/roff/groff/groff.am +++ b/src/roff/groff/groff.am @@ -44,6 +44,7 @@ groff_TESTS = \ src/roff/groff/tests/backslash-s-works-with-single-digit-argument.sh \ src/roff/groff/tests/break-zero-length-output-line-sanely.sh \ src/roff/groff/tests/cf-request-early-does-not-fail.sh \ + src/roff/groff/tests/cf-request-works.sh \ src/roff/groff/tests/check-delimiter-validity.sh \ src/roff/groff/tests/current-language-and-environment-in-sync.sh \ src/roff/groff/tests/degenerate-control-flow-works.sh \ @@ -101,6 +102,7 @@ groff_TESTS = \ src/roff/groff/tests/stringup-request-transforms-non-basic-latin.sh \ src/roff/groff/tests/substring-request-works.sh \ src/roff/groff/tests/sy-request-works.sh \ + src/roff/groff/tests/trf-request-works.sh \ src/roff/groff/tests/unencodable-things-in-grout.sh \ src/roff/groff/tests/using-diversion-as-character-works.sh \ src/roff/groff/tests/write-request-handles-empty-second-arg.sh diff --git a/src/roff/groff/tests/artifacts/throughput-file b/src/roff/groff/tests/artifacts/throughput-file new file mode 100644 index 000000000..371fe6a5e --- /dev/null +++ b/src/roff/groff/tests/artifacts/throughput-file @@ -0,0 +1 @@ +# this is a trout/grout comment diff --git a/src/roff/groff/tests/cf-request-works.sh b/src/roff/groff/tests/cf-request-works.sh new file mode 100755 index 000000000..1527c2899 --- /dev/null +++ b/src/roff/groff/tests/cf-request-works.sh @@ -0,0 +1,56 @@ +#!/bin/sh +# +# Copyright (C) 2025 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 #66863. +# +# The `cf` request should not excessively advance the input stream +# pointer. + +# Locate directory containing our test artifacts. +artifact_dir= +base=src/roff/groff/tests +dir=artifacts + +for buildroot in . .. ../.. +do + d=$buildroot/$base/$dir + if [ -d "$d" ] + then + artifact_dir=$d + break + fi +done + +# If we can't find it, we can't test. +test -z "$artifact_dir" && exit 77 # skip + +input=". +hello +.cf $artifact_dir/throughput-file +world +." + +output=$(printf "%s" "$input" | "$groff" -b -ww -Ua) +echo "$output" +echo "$output" | grep -Fqx world + +# vim:set autoindent expandtab shiftwidth=2 tabstop=2 textwidth=72: diff --git a/src/roff/groff/tests/trf-request-works.sh b/src/roff/groff/tests/trf-request-works.sh new file mode 100755 index 000000000..87d33963a --- /dev/null +++ b/src/roff/groff/tests/trf-request-works.sh @@ -0,0 +1,56 @@ +#!/bin/sh +# +# Copyright (C) 2025 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 #66863. +# +# The `trf` request should not excessively advance the input stream +# pointer. + +# Locate directory containing our test artifacts. +artifact_dir= +base=src/roff/groff/tests +dir=artifacts + +for buildroot in . .. ../.. +do + d=$buildroot/$base/$dir + if [ -d "$d" ] + then + artifact_dir=$d + break + fi +done + +# If we can't find it, we can't test. +test -z "$artifact_dir" && exit 77 # skip + +input=". +hello +.trf $artifact_dir/throughput-file +world +." + +output=$(printf "%s" "$input" | "$groff" -b -ww -a) +echo "$output" +echo "$output" | grep -Fqx world + +# vim:set autoindent expandtab shiftwidth=2 tabstop=2 textwidth=72: _______________________________________________ groff-commit mailing list groff-commit@gnu.org https://lists.gnu.org/mailman/listinfo/groff-commit