X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/7b9cb49c7c683bc69ac7fd2f20436ae2b40fbb6d..a7ec5d546fe5dbf8bc375bdb8d69f5f84789fc7e:/test/common.sh.in?ds=sidebyside diff --git a/test/common.sh.in b/test/common.sh.in index 67b18a82..004c8b1f 100644 --- a/test/common.sh.in +++ b/test/common.sh.in @@ -9,25 +9,25 @@ test -z "$MH_TEST_DIR" && MH_TEST_DIR="$MH_OBJ_DIR/test/testdir" test -z "$prefix" && prefix=@prefix@ test -z "$datarootdir" && datarootdir=@datarootdir@ test -z "$exec_prefix" && exec_prefix=@exec_prefix@ -test -z "$auxexecdir" && auxexecdir="@libdir@" +test -z "$nmhexecdir" && nmhexecdir="@libexecdir@/nmh" test -z "$bindir" && bindir="@bindir@" test -z "$mandir" && mandir="@mandir@" -test -z "$sysconfdir" && sysconfdir="@sysconfdir@" +test -z "$nmhetcdir" && nmhetcdir="@sysconfdir@/nmh" test -z "$supported_locks" && supported_locks="@supported_locks@" test -z "$default_locking" && default_locking="@default_locking@" test -z "$MULTIBYTE_ENABLED" && MULTIBYTE_ENABLED="@MULTIBYTE_ENABLED@" test -z "$ICONV_ENABLED" && ICONV_ENABLED="@ICONV_ENABLED@" -export MH_TEST_DIR auxexecdir bindir mandir sysconfdir +export MH_TEST_DIR nmhexecdir bindir mandir nmhetcdir export MULTIBYTE_ENABLED ICONV_ENABLED test -z "$MH_INST_DIR" && MH_INST_DIR="${MH_TEST_DIR}/inst" export MH_INST_DIR -unset MHBUILD MHCONTEXT MHMTSUSERCONF MHN MHSHOW MHSTORE +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 () @@ -234,9 +246,9 @@ run_test() { setup_test () { MH="${MH_TEST_DIR}/Mail/.mh_profile" - MHMTSCONF="${MH_INST_DIR}${sysconfdir}/mts.conf" - MH_LIB_DIR="${MH_INST_DIR}${auxexecdir}" - export MH MHMTSCONF MH_LIB_DIR + MHMTSCONF="${MH_INST_DIR}${nmhetcdir}/mts.conf" + MH_LIBEXEC_DIR="${MH_INST_DIR}${nmhexecdir}" + export MH MHMTSCONF MH_LIBEXEC_DIR # # Only install once @@ -273,12 +285,12 @@ setup_test () Path: ${MH_TEST_DIR}/Mail buildmimeproc: ${MH_INST_DIR}${bindir}/mhbuild fileproc: ${MH_INST_DIR}${bindir}/refile -libdir: ${MH_LIB_DIR} +libexecdir: ${MH_LIBEXEC_DIR} mhbuild: -nocontentid -mhlproc: ${MH_LIB_DIR}/mhl +mhlproc: ${MH_LIBEXEC_DIR}/mhl moreproc: cat -postproc: ${MH_LIB_DIR}/post -showproc: ${MH_LIB_DIR}/mhl +postproc: ${MH_LIBEXEC_DIR}/post +showproc: ${MH_LIBEXEC_DIR}/mhl EOF for f in MailAliases components digestcomps distcomps forwcomps mhl.body \ @@ -287,7 +299,7 @@ EOF scan.YYYYMMDD scan.curses scan.default scan.highlighted scan.mailx \ scan.nomime scan.size scan.time scan.timely scan.unseen do - cp "${MH_INST_DIR}${sysconfdir}/${f}" "${MH_TEST_DIR}/Mail" || exit 1 + cp "${MH_INST_DIR}${nmhetcdir}/${f}" "${MH_TEST_DIR}/Mail" || exit 1 done folder -create +inbox > /dev/null