Debian Codegraph @

gnulib-tests/test-wcrtomb.sh

raw
1 #!/bin/sh
2
3 # Test in the POSIX locale.
4 LC_ALL=C ${CHECKER} ./test-wcrtomb${EXEEXT} 1 || exit 1
5 LC_ALL=POSIX ${CHECKER} ./test-wcrtomb${EXEEXT} 1 || exit 1
6
7 # Test in an ISO-8859-1 or ISO-8859-15 locale.
8 : "${LOCALE_FR=fr_FR}"
9 if test $LOCALE_FR != none; then
10 LC_ALL=$LOCALE_FR \
11 ${CHECKER} ./test-wcrtomb${EXEEXT} 2 \
12 || exit 1
13 fi
14
15 # Test whether a specific UTF-8 locale is installed.
16 : "${LOCALE_EN_UTF8=en_US.UTF-8}"
17 : "${LOCALE_FR_UTF8=fr_FR.UTF-8}"
18 if test "$LOCALE_EN_UTF8" != none || test $LOCALE_FR_UTF8 != none; then
19 # It's sufficient to test in one of the two locales.
20 if test $LOCALE_FR_UTF8 != none; then
21 testlocale=$LOCALE_FR_UTF8
22 else
23 testlocale="$LOCALE_EN_UTF8"
24 fi
25 LC_ALL="$testlocale" \
26 ${CHECKER} ./test-wcrtomb${EXEEXT} 3 \
27 || exit 1
28 fi
29
30 # Test whether a specific EUC-JP locale is installed.
31 : "${LOCALE_JA=ja_JP}"
32 if test $LOCALE_JA != none; then
33 LC_ALL=$LOCALE_JA \
34 ${CHECKER} ./test-wcrtomb${EXEEXT} 4 \
35 || exit 1
36 fi
37
38 # Test whether a specific GB18030 locale is installed.
39 : "${LOCALE_ZH_CN=zh_CN.GB18030}"
40 if test $LOCALE_ZH_CN != none; then
41 LC_ALL=$LOCALE_ZH_CN \
42 ${CHECKER} ./test-wcrtomb${EXEEXT} 5 \
43 || exit 1
44 fi
45
46 exit 0