X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/af70448d4b35f6e590aaff8ef13246c58c9a336d..58eaf2c22189e6cd823eb6eb3afe2e52a2599482:/test/common.sh.in diff --git a/test/common.sh.in b/test/common.sh.in index 328d1ee8..f4225e1b 100644 --- a/test/common.sh.in +++ b/test/common.sh.in @@ -27,7 +27,7 @@ unset MAILDROP MHBUILD MHCONTEXT MHMTSUSERCONF MHN MHSHOW MHSTORE unset MHLDEBUG MHPDEBUG MHWDEBUG PAGER #### Set LC_ALL in individual tests as needed. Unset these so #### that we don't depend on user's settings in other tests. -unset LANG LC_ALL LC_TYPE +unset LANG LC_ALL LC_CTYPE #### Use a test dir for tmp files when MHTMPDIR applies. MHTMPDIR=$MH_TEST_DIR/Mail @@ -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 ()