gbranden pushed a commit to branch master
in repository groff.
commit e9f95f53ba60d65f928dfb37c2ee873db33c4a0b
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Apr 11 07:34:55 2025 -0500
[tests]: Fix code style nits.
* contrib/mom/examples/test-mom.sh.in:
* font/devpdf/tests/check-urw-foundry.sh.in:
* src/preproc/preconv/tests/smoke-test.sh:
* src/preproc/tbl/tests/do-not-segv-on-invalid-vertical-span-entry.sh:
* src/preproc/tbl/tests/do-not-segv-when-backslash-R-in-text-block.sh:
* src/roff/groff/tests/html-device-smoke-test.sh:
* src/roff/groff/tests/html-device-works-with-grn-and-eqn.sh:
* src/roff/groff/tests/regression_savannah_56555.sh:
* src/roff/groff/tests/regression_savannah_58162.sh:
* src/roff/groff/tests/regression_savannah_58337.sh:
* src/roff/groff/tests/regression_savannah_59202.sh:
* src/roff/groff/tests/soquiet-request-works.sh: In tests that (try to)
provoke SEGVs, explicitly disclose that we're skipping when a "core"
file already exists. Disclose name of test script when skipping.
Drop "set -e" where unnecessary. Add/update Vim mode lines.
---
contrib/mom/examples/test-mom.sh.in | 6 +++---
font/devpdf/tests/check-urw-foundry.sh.in | 2 +-
src/preproc/preconv/tests/smoke-test.sh | 6 +++---
.../tbl/tests/do-not-segv-on-invalid-vertical-span-entry.sh | 10 +++++++---
.../tbl/tests/do-not-segv-when-backslash-R-in-text-block.sh | 10 +++++++---
src/roff/groff/tests/html-device-smoke-test.sh | 4 ++--
src/roff/groff/tests/html-device-works-with-grn-and-eqn.sh | 6 ++++--
src/roff/groff/tests/regression_savannah_56555.sh | 4 +++-
src/roff/groff/tests/regression_savannah_58153.sh | 2 +-
src/roff/groff/tests/regression_savannah_58162.sh | 8 ++++----
src/roff/groff/tests/regression_savannah_58337.sh | 6 +++---
src/roff/groff/tests/regression_savannah_59202.sh | 12 +++++++++---
src/roff/groff/tests/soquiet-request-works.sh | 4 ++--
13 files changed, 49 insertions(+), 31 deletions(-)
diff --git a/contrib/mom/examples/test-mom.sh.in
b/contrib/mom/examples/test-mom.sh.in
index 7a32c079f..0ad8827d8 100644
--- a/contrib/mom/examples/test-mom.sh.in
+++ b/contrib/mom/examples/test-mom.sh.in
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (C) 2018-2024 Free Software Foundation, Inc.
+# Copyright (C) 2018-2025 Free Software Foundation, Inc.
#
# This file is part of groff.
#
@@ -35,7 +35,7 @@ examples="
if [ "$have_urw_fonts" != yes ]
then
- echo "URW fonts needed to generate mom examples; skipping test" >&2
+ echo "$0: URW fonts needed to generate mom examples; skipping" >&2
exit 77 # skip
fi
@@ -109,4 +109,4 @@ check_has_images "$examplesdir/slide-demo.pdf" 2
exit $ret
-# vim:set ai et sw=4 ts=4 tw=72:
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:
diff --git a/font/devpdf/tests/check-urw-foundry.sh.in
b/font/devpdf/tests/check-urw-foundry.sh.in
index d31b3aa3e..de67cab22 100755
--- a/font/devpdf/tests/check-urw-foundry.sh.in
+++ b/font/devpdf/tests/check-urw-foundry.sh.in
@@ -83,4 +83,4 @@ done
test -z "$fail"
-# vim:set ai et sw=4 ts=4 tw=72:
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:
diff --git a/src/preproc/preconv/tests/smoke-test.sh
b/src/preproc/preconv/tests/smoke-test.sh
index 2bdbbf8ed..e6d94dac6 100755
--- a/src/preproc/preconv/tests/smoke-test.sh
+++ b/src/preproc/preconv/tests/smoke-test.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (C) 2020-2024 Free Software Foundation, Inc.
+# Copyright (C) 2020-2025 Free Software Foundation, Inc.
#
# This file is part of groff.
#
@@ -71,7 +71,7 @@ test -z "$fail" || exit
# We need uchardet to work to get past this point.
if ! "$preconv" -v | grep -q 'with uchardet support'
then
- echo "preconv lacks uchardet support; skipping test" >&2
+ echo "$0: preconv lacks uchardet support; skipping test" >&2
exit 77 # skip
fi
@@ -120,4 +120,4 @@ printf 'Eat at the caf\351.\n' \
test -z "$fail"
-# vim:set ai et sw=4 ts=4 tw=72:
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:
diff --git
a/src/preproc/tbl/tests/do-not-segv-on-invalid-vertical-span-entry.sh
b/src/preproc/tbl/tests/do-not-segv-on-invalid-vertical-span-entry.sh
index 1d672ec5e..5ae558654 100755
--- a/src/preproc/tbl/tests/do-not-segv-on-invalid-vertical-span-entry.sh
+++ b/src/preproc/tbl/tests/do-not-segv-on-invalid-vertical-span-entry.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (C) 2021 Free Software Foundation, Inc.
+# Copyright (C) 2021-2025 Free Software Foundation, Inc.
#
# This file is part of groff.
#
@@ -25,7 +25,11 @@ tbl="${abs_top_builddir:-.}/tbl"
# Don't segfault because we tried to span down from an invalid span that
# tbl neglected to replace with an empty table entry.
-test -f core && exit 77 # skip
+if [ -e core ]
+then
+ echo "$0: 'core' file already exists; skipping" >&2
+ exit 77 # skip
+fi
input=$(cat <<EOF
.TS
@@ -38,4 +42,4 @@ EOF
output=$(printf "%s" "$input" | "$tbl")
! test -f core
-# vim:set ai noet sw=4 ts=4 tw=72:
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:
diff --git
a/src/preproc/tbl/tests/do-not-segv-when-backslash-R-in-text-block.sh
b/src/preproc/tbl/tests/do-not-segv-when-backslash-R-in-text-block.sh
index 30bd9f6f5..f29718b82 100755
--- a/src/preproc/tbl/tests/do-not-segv-when-backslash-R-in-text-block.sh
+++ b/src/preproc/tbl/tests/do-not-segv-when-backslash-R-in-text-block.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (C) 2022 Free Software Foundation, Inc.
+# Copyright (C) 2022-2025 Free Software Foundation, Inc.
#
# This file is part of groff.
#
@@ -32,7 +32,11 @@ wail () {
# Do not SEGV when a text block begins with a repeating glyph token, and
# do not malformat the output if it ends with one.
-test -f core && exit 77 # skip
+if [ -e core ]
+then
+ echo "$0: 'core' file already exists; skipping" >&2
+ exit 77 # skip
+fi
input='.TS
L.
@@ -72,4 +76,4 @@ echo "$output" | sed -n 3p | grep -qx 'foo a bar' || wail
test -z "$fail"
-# vim:set ai et sw=4 ts=4 tw=72:
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:
diff --git a/src/roff/groff/tests/html-device-smoke-test.sh
b/src/roff/groff/tests/html-device-smoke-test.sh
index 7cc3cf8ec..bf9228c1d 100755
--- a/src/roff/groff/tests/html-device-smoke-test.sh
+++ b/src/roff/groff/tests/html-device-smoke-test.sh
@@ -87,7 +87,7 @@ fi
if [ -n "$give_up" ]
then
- echo "$message; skipping test" >&2
+ echo "$0: $message; skipping test" >&2
exit 77 # skip
fi
@@ -108,4 +108,4 @@ printf '\\('"'"a | "$groff" -C -k -Thtml | grep -qx
'<p>á</p>' \
test -z "$fail"
-# vim:set ai et sw=4 ts=4 tw=72:
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:
diff --git a/src/roff/groff/tests/html-device-works-with-grn-and-eqn.sh
b/src/roff/groff/tests/html-device-works-with-grn-and-eqn.sh
index d757bf58a..223c97833 100755
--- a/src/roff/groff/tests/html-device-works-with-grn-and-eqn.sh
+++ b/src/roff/groff/tests/html-device-works-with-grn-and-eqn.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (C) 2020 Free Software Foundation, Inc.
+# Copyright (C) 2020-2025 Free Software Foundation, Inc.
#
# This file is part of groff.
#
@@ -26,7 +26,7 @@ for cmd in pnmcrop pamcut pnmtopng pnmtops ps2ps
do
if ! command -v $cmd >/dev/null
then
- echo "cannot locate '$cmd' command; skipping test" >&2
+ echo "$0: cannot locate '$cmd' command; skipping test" >&2
exit 77 # skip
fi
done
@@ -44,3 +44,5 @@ The faster clocks are $ PN $'
output=$("$groff" -b -ww -Thtml -eg -me "$input")
test -n "$output"
+
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:
diff --git a/src/roff/groff/tests/regression_savannah_56555.sh
b/src/roff/groff/tests/regression_savannah_56555.sh
index 3d13f1690..bc150aa53 100755
--- a/src/roff/groff/tests/regression_savannah_56555.sh
+++ b/src/roff/groff/tests/regression_savannah_56555.sh
@@ -20,8 +20,10 @@
groff="${abs_top_builddir:-.}/test-groff"
-# Check for segfault if we try to write a glyph before setting up.
+# Check for fatal error if we try to write a glyph before setting up.
# Savannah #56555.
"$groff" >/dev/null <<EOF
\!ta
EOF
+
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:
diff --git a/src/roff/groff/tests/regression_savannah_58153.sh
b/src/roff/groff/tests/regression_savannah_58153.sh
index fa5906335..9b2efbab3 100755
--- a/src/roff/groff/tests/regression_savannah_58153.sh
+++ b/src/roff/groff/tests/regression_savannah_58153.sh
@@ -44,4 +44,4 @@ printf "%s\n" "$output" | grep -qw 'backtrace: file' || wail
test -z "$fail"
-# vim:set autoindent expandtab shiftwidth=2 tabstop=2 textwidth=72:
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:
diff --git a/src/roff/groff/tests/regression_savannah_58162.sh
b/src/roff/groff/tests/regression_savannah_58162.sh
index d744e9930..702e9063c 100755
--- a/src/roff/groff/tests/regression_savannah_58162.sh
+++ b/src/roff/groff/tests/regression_savannah_58162.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (C) 2020 Free Software Foundation, Inc.
+# Copyright (C) 2020-2025 Free Software Foundation, Inc.
#
# This file is part of groff.
#
@@ -20,7 +20,7 @@
groff="${abs_top_builddir:-.}/test-groff"
-set -e
-
# Compatibility mode should not get shut off by macro file inclusion.
-printf '.ds FOO FAIL\n\\*[FOO]' | "$groff" -C -Tutf8 | grep -Fx 'FOO]'
+printf '.ds FOO FAIL\n\\*[FOO]' | "$groff" -C -Tutf8 | grep -Fqx 'FOO]'
+
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:
diff --git a/src/roff/groff/tests/regression_savannah_58337.sh
b/src/roff/groff/tests/regression_savannah_58337.sh
index 7928651d9..41a9b2a7c 100755
--- a/src/roff/groff/tests/regression_savannah_58337.sh
+++ b/src/roff/groff/tests/regression_savannah_58337.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (C) 2020 Free Software Foundation, Inc.
+# Copyright (C) 2020-2025 Free Software Foundation, Inc.
#
# This file is part of groff.
#
@@ -20,8 +20,6 @@
groff="${abs_top_builddir:-.}/test-groff"
-set -e
-
# groff should ignore negative inter-word and inter-sentence space
# sizes. And certainly not fail an assertion. Savannah #58337.
"$groff" -Tascii <<EOF | grep -Fqx 'A B. C.'
@@ -30,3 +28,5 @@ set -e
A B.
C.
EOF
+
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:
diff --git a/src/roff/groff/tests/regression_savannah_59202.sh
b/src/roff/groff/tests/regression_savannah_59202.sh
index 6d8bdc174..85f3640dd 100755
--- a/src/roff/groff/tests/regression_savannah_59202.sh
+++ b/src/roff/groff/tests/regression_savannah_59202.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (C) 2020 Free Software Foundation, Inc.
+# Copyright (C) 2020-2025 Free Software Foundation, Inc.
#
# This file is part of groff.
#
@@ -23,7 +23,13 @@ groff="${abs_top_builddir:-.}/test-groff"
# troff should not segfault when its standard output is closed.
# Savannah #59202.
-# If a core file already exists, it should be dealt with; skip test.
-test -e core && exit 77
+if [ -e core ]
+then
+ echo "$0: 'core' file already exists; skipping" >&2
+ exit 77 # skip
+fi
+
echo | "$groff" >&-
! test -e core
+
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:
diff --git a/src/roff/groff/tests/soquiet-request-works.sh
b/src/roff/groff/tests/soquiet-request-works.sh
index f33c17709..83af6c1a2 100755
--- a/src/roff/groff/tests/soquiet-request-works.sh
+++ b/src/roff/groff/tests/soquiet-request-works.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (C) 2021-2024 Free Software Foundation, Inc.
+# Copyright (C) 2021-2025 Free Software Foundation, Inc.
#
# This file is part of groff.
#
@@ -27,7 +27,7 @@ set -e
# The "unset" in Solaris /usr/xpg4/bin/sh can actually fail.
if ! unset GROFF_ENCODING
then
- echo "unable to clear environment; skipping" >&2
+ echo "$0: unable to clear environment; skipping" >&2
exit 77
fi
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit