3 # Copyright (C) 2022 Free Software Foundation, Inc.
5 # This file is part of groff.
7 # groff is free software; you can redistribute it and/or modify it under
8 # the terms of the GNU General Public License as published by the Free
9 # Software Foundation, either version 3 of the License, or (at your
10 # option) any later version.
12 # groff is distributed in the hope that it will be useful, but WITHOUT
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
23 preconv="${abs_top_builddir:-.}/preconv"
32 # Scrape debugging output to see if we're skipping unseekable streams.
33 # This is fragile, but we don't want to lock the language of diagnostic
34 # messages (especially debugging ones). If this test fails, check the
35 # text of the command's debugging output for a mismatch before
36 # investigating deeper problems.
38 echo "testing seekability of file operand '-'" >&2
39 output=$(printf '' | "$preconv" -d - 2>&1)
40 echo "$output" | grep -q "stream is not seekable" || wail
42 # /dev/stdin might not exist in a chroot. Or, if it's not (a symbolic
43 # link to) a character special device, the next test will not be valid,
44 # as when using GNU Make's `-j` option.
46 # Similarly, we must have a controlling terminal.
48 echo "skipping if /dev/stdin is not a character device" >&2
49 test -c /dev/stdin || exit 77 # skip
50 echo "skipping if there is no controlling terminal" >&2
51 test "$(tty)" != "not a tty" || exit 77 # skip
53 echo "testing seekability of standard input stream" >&2
54 output=$(printf '' | "$preconv" -d /dev/stdin 2>&1)
55 echo "$output" | grep -q "stream is not seekable" || wail
59 # vim:set ai et sw=4 ts=4 tw=72: