groff-commit
[Top][All Lists]
Advanced

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

[groff] 23/26: Use more consistent test skipping idiom.


From: G. Branden Robinson
Subject: [groff] 23/26: Use more consistent test skipping idiom.
Date: Sat, 13 Jul 2024 16:20:53 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit c0dff37432ce836ec4d5e727e1cd63be17efc448
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Jul 13 14:46:37 2024 -0500

    Use more consistent test skipping idiom.
    
    It's more economical, too.
    
    * font/devpdf/tests/check-default-foundry.sh.in:
    * src/devices/grotty/tests/basic_latin_glyphs_map_correctly.sh:
    * src/roff/groff/tests/smoke-test_html_device.sh: Do it.
---
 font/devpdf/tests/check-default-foundry.sh.in                |  2 ++
 src/devices/grotty/tests/basic_latin_glyphs_map_correctly.sh | 12 ++++--------
 src/roff/groff/tests/smoke-test_html_device.sh               | 12 ++++--------
 3 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/font/devpdf/tests/check-default-foundry.sh.in 
b/font/devpdf/tests/check-default-foundry.sh.in
index 026cc012a..b2bbec13b 100755
--- a/font/devpdf/tests/check-default-foundry.sh.in
+++ b/font/devpdf/tests/check-default-foundry.sh.in
@@ -81,6 +81,8 @@ do
     test -f "$devpdf_fontbuilddir"/"$f" || wail
 done
 
+test -z "$fail" || exit
+
 if [ "$ghostscript" = no ] || [ "$ghostscript" = missing ]
 then
     echo "Ghostscript not available; skipping check for any further" \
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 5067e4b6a..f36105bde 100755
--- a/src/devices/grotty/tests/basic_latin_glyphs_map_correctly.sh
+++ b/src/devices/grotty/tests/basic_latin_glyphs_map_correctly.sh
@@ -135,16 +135,12 @@ do
             give_up=yes
         fi
 
+        test -z "$fail" || exit
+
         if [ -n "$give_up" ]
         then
-            # If we've already seen a failure case, report it.
-            if [ -n "$fail" ]
-            then
-                exit 1 # fail
-            else
-                echo "$message; skipping test" >&2
-                exit 77 # skip
-            fi
+            echo "$message; skipping test" >&2
+            exit 77 # skip
         fi
     fi
 
diff --git a/src/roff/groff/tests/smoke-test_html_device.sh 
b/src/roff/groff/tests/smoke-test_html_device.sh
index 952022966..e57299de5 100755
--- a/src/roff/groff/tests/smoke-test_html_device.sh
+++ b/src/roff/groff/tests/smoke-test_html_device.sh
@@ -67,6 +67,8 @@ echo "$output" | grep -q '<img src="grohtml-[0-9]\+-2.png"' 
|| wail
 
 cleanup
 
+test -z "$fail" || exit
+
 give_up=
 message=
 
@@ -85,14 +87,8 @@ fi
 
 if [ -n "$give_up" ]
 then
-    # If we've already seen a failure case, report it.
-    if [ -n "$fail" ]
-    then
-        exit 1 # fail
-    else
-        echo "$message; skipping test" >&2
-        exit 77 # skip
-    fi
+    echo "$message; skipping test" >&2
+    exit 77 # skip
 fi
 
 # Check two forms of character transformation.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]