summaryrefslogtreecommitdiff
path: root/src/roff
diff options
context:
space:
mode:
Diffstat (limited to 'src/roff')
-rwxr-xr-xsrc/roff/groff/tests/initialization_is_quiet.sh35
1 files changed, 26 insertions, 9 deletions
diff --git a/src/roff/groff/tests/initialization_is_quiet.sh b/src/roff/groff/tests/initialization_is_quiet.sh
index f693840c6..38ac81ffc 100755
--- a/src/roff/groff/tests/initialization_is_quiet.sh
+++ b/src/roff/groff/tests/initialization_is_quiet.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (C) 2021 Free Software Foundation, Inc.
+# Copyright (C) 2021-2023 Free Software Foundation, Inc.
#
# This file is part of groff.
#
@@ -20,7 +20,12 @@
groff="${abs_top_builddir:-.}/test-groff"
-set -e
+fail=
+
+wail () {
+ echo ...FAILED >&2
+ fail=YES
+}
# Regression-test Savannah #60874.
#
@@ -28,15 +33,27 @@ set -e
# or not, without producing diagnostics.
# Keep preconv from being run.
-unset GROFF_ENCODING
+#
+# The "unset" in Solaris /usr/xpg4/bin/sh can actually fail.
+if ! unset GROFF_ENCODING
+then
+ echo "unable to clear environment; skipping" >&2
+ exit 77
+fi
-for COMPAT in "" -C
+for compat in "" " -C"
do
- for LOCALE in cs de en fr it ja sv zh
+ for locale in cs de en fr it ja sv zh
do
- echo "testing \"-m $LOCALE\"; COMPAT=\"$COMPAT\""
- OUTPUT=$("$groff" -ww -m $LOCALE "$COMPAT" < /dev/null 2>&1)
- echo "$OUTPUT"
- test -z "$OUTPUT"
+ echo testing \"-m $locale$compat\" >&2
+ output=$("$groff" -ww -m $locale$compat -a </dev/null 2>/dev/null)
+ error=$("$groff" -ww -m $locale$compat -z </dev/null 2>&1)
+ test -n "$error" && echo "$error"
+ test -n "$output" && echo "$output"
+ test -n "$error$output" && wail
done
done
+
+test -z "$fail"
+
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72: