groff-commit
[Top][All Lists]
Advanced

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

[groff] 03/41: [preconv]: Regression-test Savannah #62131.


From: G. Branden Robinson
Subject: [groff] 03/41: [preconv]: Regression-test Savannah #62131.
Date: Sat, 5 Mar 2022 16:06:09 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit fffc018c0d5faeb6b7954291e2998f911c20197b
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Mar 4 07:40:35 2022 +1100

    [preconv]: Regression-test Savannah #62131.
    
    * src/preproc/preconv/tests/do-not-seek-the-unseekable.sh: Do it.
    * src/preproc/preconv/preconv.am (preconv_TESTS): Run test.
    
    Test fails at this commit.
---
 ChangeLog                                          |  8 ++++
 src/preproc/preconv/preconv.am                     |  1 +
 .../preconv/tests/do-not-seek-the-unseekable.sh    | 48 ++++++++++++++++++++++
 3 files changed, 57 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 6c66a83e..5ceff01e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-03-04  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [preconv]: Regression-test Savannah #62131.
+
+       * src/preproc/preconv/tests/do-not-seek-the-unseekable.sh: Do
+       it.
+       * src/preproc/preconv/preconv.am (preconv_TESTS): Run test.
+
 2022-03-01  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/preproc/tbl/main.cpp (process_format): Update diagnostic
diff --git a/src/preproc/preconv/preconv.am b/src/preproc/preconv/preconv.am
index 2358a5f4..199ff66f 100644
--- a/src/preproc/preconv/preconv.am
+++ b/src/preproc/preconv/preconv.am
@@ -24,6 +24,7 @@ man1_MANS += src/preproc/preconv/preconv.1
 EXTRA_DIST += src/preproc/preconv/preconv.1.man
 
 preconv_TESTS = \
+  src/preproc/preconv/tests/do-not-seek-the-unseekable.sh \
   src/preproc/preconv/tests/smoke-test.sh
 TESTS += $(preconv_TESTS)
 EXTRA_DIST += $(preconv_TESTS)
diff --git a/src/preproc/preconv/tests/do-not-seek-the-unseekable.sh 
b/src/preproc/preconv/tests/do-not-seek-the-unseekable.sh
new file mode 100755
index 00000000..bf25b060
--- /dev/null
+++ b/src/preproc/preconv/tests/do-not-seek-the-unseekable.sh
@@ -0,0 +1,48 @@
+#!/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/>.
+#
+
+set -e
+
+preconv="${abs_top_builddir:-.}/preconv"
+
+fail=
+
+wail () {
+    echo FAILED >&2
+    fail=YES
+}
+
+# Scrape debugging output to see if we're skipping unseekable streams.
+# This is fragile, but we don't want to lock the language of diagnostic
+# messages (especially debugging ones).  If this test fails, check the
+# text of the command's debugging output for a mismatch before
+# investigating deeper problems.
+
+echo "testing seekability of file operand '-'" >&2
+output=$(printf '' | "$preconv" -d - 2>&1)
+echo "$output" | grep -q "stream is not seekable" || wail
+
+echo "testing seekability of standard input stream" >&2
+output=$(printf '' | "$preconv" -d /dev/stdin 2>&1)
+echo "$output" | grep -q "stream is not seekable" || 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]