]> diplodocus.org Git - nmh/commitdiff
Skip (parts of) tests that require en_US.utf8 locale if it's
authorDavid Levine <levinedl@acm.org>
Sat, 14 Jun 2014 16:52:42 +0000 (11:52 -0500)
committerDavid Levine <levinedl@acm.org>
Sat, 14 Jun 2014 16:52:42 +0000 (11:52 -0500)
not available.  Thanks to Alexander Zangerl for reporting the
issue.

13 files changed:
test/common.sh.in
test/dist/test-dist
test/mhbuild/test-attach
test/mhbuild/test-cte
test/mhbuild/test-ext-params
test/mhbuild/test-header-encode
test/mhbuild/test-utf8-body
test/mhfixmsg/test-mhfixmsg
test/mhlist/test-ext-params
test/mhshow/test-charset
test/mhshow/test-textcharset
test/pick/test-pick
test/scan/test-scan-multibyte

index a0088087be75ffdf59ba54b5feec81aad2a06fc1..f4225e1b62c35c85e4d6e459390e0c6f1db20d3b 100644 (file)
@@ -85,6 +85,18 @@ require_prog ()
   fi
 }
 
+# Skip test if none of the offered locales are supported.
+require_locale ()
+{
+  for locale in "$@"; do
+    if locale -a | grep -i "$locale" >/dev/null; then
+        return
+    fi
+  done
+
+  test_skip "no suitable locale available"
+}
+
 # Some stuff for doing silly progress indicators
 if [ -t 1 ] ; then
   progress_update ()
index c082b5e349c16887c18720a0bac8163aef9a739b..6c3c80b5ec3521057428ed4a4210209475779c99 100755 (executable)
@@ -388,6 +388,7 @@ run_test 'scan +outbox -width 6 2' '   2 '
 # Check that dist encodes headers using RFC-2047 properly
 #
 
+require_locale en_US.utf8
 LC_ALL=en_US.UTF-8; export LC_ALL
 
 cat >"$expected" <<EOF
index f51d2bc34129c7ed37374420825863627adfb257..8e2edf83c729c9a1f2239c3ad0b467011147ac43 100755 (executable)
@@ -14,6 +14,7 @@ fi
 
 setup_test
 
+require_locale en_US.utf8
 LC_ALL=en_US.UTF-8; export LC_ALL
 
 draft="$MH_TEST_DIR/$$.draft"
index f996e73ea6dec988a1134d343a1d30b21586f6fe..b63f1998f1368648d24380ea231707305f105658 100755 (executable)
@@ -16,6 +16,7 @@ setup_test
 
 set -e
 
+require_locale en_US.utf8
 LC_ALL=en_US.UTF-8; export LC_ALL
 
 draft="$MH_TEST_DIR/$$.draft"
index 0b5e66dabe5e15331c489ef44acd0869268ea631..4e28ab4719f76644d4f70ffc4ff3d8bbefcf3657 100755 (executable)
@@ -14,6 +14,7 @@ fi
 
 setup_test
 
+require_locale en_US.utf8
 LC_ALL=en_US.UTF-8; export LC_ALL
 
 draft="$MH_TEST_DIR/$$.draft"
index e4883b5ab929ffcb368ea3090e52301ffa13faaa..7cc25bed6e2332d8c944782ca6b8b8a3d8e15c4a 100755 (executable)
@@ -21,7 +21,7 @@ backupname="${MH_TEST_DIR}/`mhparam sbackup`$$"
 #
 # We're going to hardcode UTF-8 for this test.
 #
-
+require_locale en_US.utf8
 LC_ALL=en_US.UTF-8; export LC_ALL
 
 #
index 13629706c60cd101a96fd077c59412139693728f..377d6237c3b60542bb15cbe472cac73ce5f35315 100755 (executable)
@@ -19,6 +19,7 @@ testname="${MH_TEST_DIR}/$$"
 expected="$MH_TEST_DIR/$$.expected"
 actual="$MH_TEST_DIR/$$.actual"
 
+require_locale en_US.utf8
 LC_ALL=en_US.UTF-8; export LC_ALL
 
 #### Rely on sendmail/pipe below to override default mts.
index d60b9d768d7942021bfa080e69971061925a2167..dea2ddc5847fca43411cea941a2b4b5a59eb7f8c 100755 (executable)
@@ -14,14 +14,15 @@ fi
 
 . "${srcdir}/test/post/test-post-common.sh"
 
+#### Make sure that html-to-text conversion is what we expect.
+require_locale en_US.utf8
+LC_ALL=en_US.UTF-8; export LC_ALL
+
 expected="$MH_TEST_DIR/test-mhfixmsg$$.expected"
 expected_err="$MH_TEST_DIR/test-mhfixmsg$$.expected_err"
 actual="$MH_TEST_DIR/test-mhfixmsg$$.actual"
 actual_err="$MH_TEST_DIR/test-mhfixmsg$$.actual_err"
 
-#### Make sure that html-to-text conversion is what we expect.
-LC_ALL=en_US.UTF-8; export LC_ALL
-
 if grep mhfixmsg-format-text/html "${MH_TEST_DIR}/Mail/mhn.defaults" \
   >/dev/null; then
   can_reformat_texthtml=1
index 409a4edab39f0e8858a1d5dd71591a24a819916d..2e2373e5783a25475caf181a19bfcfa205a22db3 100755 (executable)
@@ -16,9 +16,11 @@ fi
 
 setup_test
 
+require_locale en_US.utf8
+LC_ALL=en_US.UTF-8; export LC_ALL
+
 expected=$MH_TEST_DIR/$$.expected
 actual=$MH_TEST_DIR/$$.actual
-LC_ALL=en_US.UTF-8; export LC_ALL
 
 #
 # Write a message with some extended parameters
index c41e51276cd8bbcf3303fc1d9604e08c6f3fa8eb..39f52a67c08f0d83dcc7508a3e010205601cba04 100755 (executable)
@@ -16,6 +16,7 @@ fi
 
 setup_test
 
+require_locale en_US.utf8
 LC_ALL=en_US.UTF-8; export LC_ALL
 
 test "$ICONV_ENABLED" -eq 0  &&  text_size=10  || text_size=11
index a66db46fd71af977eb9a436affbfad2c80fa6201..f21ea56f1f0559e5a55f67dffbe9ca07821efe28 100755 (executable)
@@ -20,6 +20,7 @@ if test "$ICONV_ENABLED" -eq 0; then
   test_skip 'test-textcharset requires that nmh have been built with iconv'
 fi
 
+require_locale en_US.utf8
 LC_ALL=en_US.UTF-8; export LC_ALL
 
 expected="$MH_TEST_DIR"/$$.expected
index ea00b8150201f566fd97aec25b9955d7f38c562f..7c3896ea3c7911ae97273bb519fc6b63a64b8953 100755 (executable)
@@ -262,6 +262,7 @@ echo 13 >"$expected"
 
 set +e
 
+require_locale en_US.utf8
 # Don't use run_prog here because it loses the environment setting.
 LC_ALL=en_US.UTF-8 pick -subject foobar 13 >"$actual" 2>&1
 set -e
index fb9747d64892fc36532bc0a74f30f5429897b396..9dae456e670c18fc9eaedfef444065cfb2bbe24d 100755 (executable)
@@ -26,6 +26,7 @@ if test "${MULTIBYTE_ENABLED}" -ne 1; then
     test_skip "configure did not detect multibyte support"
 fi
 
+require_locale en_US.utf8
 LC_ALL=en_US.UTF-8; export LC_ALL
 
 #