[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 05/07: [test]: Be more explicit when skipping tests.
|
From: |
G. Branden Robinson |
|
Subject: |
[groff] 05/07: [test]: Be more explicit when skipping tests. |
|
Date: |
Wed, 31 Jan 2024 06:25:15 -0500 (EST) |
gbranden pushed a commit to branch master
in repository groff.
commit cfaf862bc29dfbfd02abd0788dfd3b0bd445415e
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Jan 31 04:34:53 2024 -0600
[test]: Be more explicit when skipping tests.
* src/devices/grotty/tests/basic_latin_glyphs_map_correctly.sh:
* src/preproc/preconv/tests/do-not-seek-the-unseekable.sh:
* src/roff/groff/tests/smoke-test_html_device.sh:
* tmac/tests/pdfpic_does-not-choke-on-bad-pdfinfo-output.sh: Do it.
* src/preproc/preconv/tests/do-not-seek-the-unseekable.sh: Also actually
exit early with a failure status if a preceding test failed before
performing the checks that can be skipped.
---
.../grotty/tests/basic_latin_glyphs_map_correctly.sh | 2 ++
.../preconv/tests/do-not-seek-the-unseekable.sh | 18 +++++++++++++-----
src/roff/groff/tests/smoke-test_html_device.sh | 6 +++++-
.../pdfpic_does-not-choke-on-bad-pdfinfo-output.sh | 2 +-
4 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/src/devices/grotty/tests/basic_latin_glyphs_map_correctly.sh
b/src/devices/grotty/tests/basic_latin_glyphs_map_correctly.sh
index 92552d27d..6333b4d26 100755
--- a/src/devices/grotty/tests/basic_latin_glyphs_map_correctly.sh
+++ b/src/devices/grotty/tests/basic_latin_glyphs_map_correctly.sh
@@ -128,6 +128,8 @@ do
then
exit 1 # fail
else
+ echo "environment does not support UTF-8;" \
+ "skipping test" >&2
exit 77 # skip
fi
fi
diff --git a/src/preproc/preconv/tests/do-not-seek-the-unseekable.sh
b/src/preproc/preconv/tests/do-not-seek-the-unseekable.sh
index 2b1142d5b..56298cdd0 100755
--- a/src/preproc/preconv/tests/do-not-seek-the-unseekable.sh
+++ b/src/preproc/preconv/tests/do-not-seek-the-unseekable.sh
@@ -39,16 +39,24 @@ echo "testing seekability of file operand '-'" >&2
output=$(printf '' | "$preconv" -d - 2>&1)
echo "$output" | grep -q "stream is not seekable" || wail
+test -z "$fail" || exit
+
# /dev/stdin might not exist in a chroot. Or, if it's not (a symbolic
# link to) a character special device, the next test will not be valid,
# as when using GNU Make's `-j` option.
#
# Similarly, we must have a controlling terminal.
-test -z "$fail"
-echo "skipping if /dev/stdin is not a character device" >&2
-test -c /dev/stdin || exit 77 # skip
-echo "skipping if there is no controlling terminal" >&2
-test "$(tty)" != "not a tty" || exit 77 # skip
+if ! [ -c /dev/stdin ]
+then
+ echo "/dev/stdin is not a character device; skipping test" >&2
+ exit 77 # skip
+fi
+
+if [ "$(tty)" = "not a tty" ]
+then
+ echo "there is no controlling terminal; skipping test" >&2
+ exit 77 # skip
+fi
echo "testing seekability of standard input stream" >&2
output=$(printf '' | "$preconv" -d /dev/stdin 2>&1)
diff --git a/src/roff/groff/tests/smoke-test_html_device.sh
b/src/roff/groff/tests/smoke-test_html_device.sh
index 877fc28fb..36dc50e47 100755
--- a/src/roff/groff/tests/smoke-test_html_device.sh
+++ b/src/roff/groff/tests/smoke-test_html_device.sh
@@ -68,7 +68,11 @@ echo "$output" | grep -q '<img src="grohtml-[0-9]\+-2.png"'
|| wail
cleanup
# We can't run remaining tests if the environment doesn't support UTF-8.
-test "$(locale charmap)" = UTF-8 || exit 77 # skip
+if [ "$(locale charmap)" != UTF-8 ]
+then
+ echo "environment does not support UTF-8; skipping test" >&2
+ exit 77 # skip
+fi
# Check two forms of character transformation.
#
diff --git a/tmac/tests/pdfpic_does-not-choke-on-bad-pdfinfo-output.sh
b/tmac/tests/pdfpic_does-not-choke-on-bad-pdfinfo-output.sh
index 7e58849c5..07a842bd7 100755
--- a/tmac/tests/pdfpic_does-not-choke-on-bad-pdfinfo-output.sh
+++ b/tmac/tests/pdfpic_does-not-choke-on-bad-pdfinfo-output.sh
@@ -29,7 +29,7 @@ for cmd in gs pdfinfo
do
if ! command -v $cmd >/dev/null
then
- echo "cannot locate '$cmd' command" >&2
+ echo "cannot locate '$cmd' command; skipping test" >&2
exit 77 # skip
fi
done
| [Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 05/07: [test]: Be more explicit when skipping tests.,
G. Branden Robinson <=