* tests/test-mcel-1.sh: New file, based on tests/test-mbrtowc-1.sh.
* tests/test-mcel-2.sh: New file, based on tests/test-mbrtowc-2.sh.
* tests/test-mcel-3.sh: New file, based on tests/test-mbrtowc-3.sh.
* tests/test-mcel-4.sh: New file, based on tests/test-mbrtowc-4.sh.
* tests/test-mcel-5.sh: New file, based on tests/test-mbrtowc-5.sh.
* modules/mcel-tests (Files): Add them. Add tests/macros.h,
m4/locale-fr.m4, m4/locale-ja.m4, m4/locale-zh.m4, m4/codeset.m4.
(Depends-on): Remove assert-h.
(configure.ac, Makefile.am): Essentially copy from
modules/mbrtowc-tests.
+2024-05-21 Bruno Haible <bruno@clisp.org>
+
+ mcel tests: Run the test in several locales.
+ * tests/test-mcel-1.sh: New file, based on tests/test-mbrtowc-1.sh.
+ * tests/test-mcel-2.sh: New file, based on tests/test-mbrtowc-2.sh.
+ * tests/test-mcel-3.sh: New file, based on tests/test-mbrtowc-3.sh.
+ * tests/test-mcel-4.sh: New file, based on tests/test-mbrtowc-4.sh.
+ * tests/test-mcel-5.sh: New file, based on tests/test-mbrtowc-5.sh.
+ * modules/mcel-tests (Files): Add them. Add tests/macros.h,
+ m4/locale-fr.m4, m4/locale-ja.m4, m4/locale-zh.m4, m4/codeset.m4.
+ (Depends-on): Remove assert-h.
+ (configure.ac, Makefile.am): Essentially copy from
+ modules/mbrtowc-tests.
+
2024-05-21 Bruno Haible <bruno@clisp.org>
flock tests: Mark as expected failure on Solaris 11.
Files:
+tests/test-mcel-1.sh
+tests/test-mcel-2.sh
+tests/test-mcel-3.sh
+tests/test-mcel-4.sh
+tests/test-mcel-5.sh
tests/test-mcel.c
+tests/macros.h
+m4/locale-fr.m4
+m4/locale-ja.m4
+m4/locale-zh.m4
+m4/codeset.m4
Depends-on:
-assert-h
setlocale
configure.ac:
+gt_LOCALE_FR
+gt_LOCALE_FR_UTF8
+gt_LOCALE_JA
+gt_LOCALE_ZH_CN
Makefile.am:
-TESTS += test-mcel
+TESTS += \
+ test-mcel-1.sh test-mcel-2.sh test-mcel-3.sh test-mcel-4.sh test-mcel-5.sh
+TESTS_ENVIRONMENT += \
+ LOCALE_FR='@LOCALE_FR@' \
+ LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
+ LOCALE_JA='@LOCALE_JA@' \
+ LOCALE_ZH_CN='@LOCALE_ZH_CN@'
check_PROGRAMS += test-mcel
test_mcel_LDADD = $(LDADD) $(LIBUNISTRING) $(SETLOCALE_LIB) $(MBRTOWC_LIB) $(LIBC32CONV)
--- /dev/null
+#!/bin/sh
+
+# Test whether the POSIX locale has encoding errors.
+LC_ALL=C \
+${CHECKER} ./test-mcel${EXEEXT} 1 || exit 1
+LC_ALL=POSIX \
+${CHECKER} ./test-mcel${EXEEXT} 1 || exit 1
+
+exit 0
--- /dev/null
+#!/bin/sh
+
+# Test in an ISO-8859-1 or ISO-8859-15 locale.
+: "${LOCALE_FR=fr_FR}"
+if test $LOCALE_FR = none; then
+ if test -f /usr/bin/localedef; then
+ echo "Skipping test: no traditional french locale is installed"
+ else
+ echo "Skipping test: no traditional french locale is supported"
+ fi
+ exit 77
+fi
+
+LC_ALL=$LOCALE_FR \
+${CHECKER} ./test-mcel${EXEEXT} 2
--- /dev/null
+#!/bin/sh
+
+# Test whether a specific UTF-8 locale is installed.
+: "${LOCALE_FR_UTF8=fr_FR.UTF-8}"
+if test $LOCALE_FR_UTF8 = none; then
+ if test -f /usr/bin/localedef; then
+ echo "Skipping test: no french Unicode locale is installed"
+ else
+ echo "Skipping test: no french Unicode locale is supported"
+ fi
+ exit 77
+fi
+
+LC_ALL=$LOCALE_FR_UTF8 \
+${CHECKER} ./test-mcel${EXEEXT} 3
--- /dev/null
+#!/bin/sh
+
+# Test whether a specific EUC-JP locale is installed.
+: "${LOCALE_JA=ja_JP}"
+if test $LOCALE_JA = none; then
+ if test -f /usr/bin/localedef; then
+ echo "Skipping test: no traditional japanese locale is installed"
+ else
+ echo "Skipping test: no traditional japanese locale is supported"
+ fi
+ exit 77
+fi
+
+LC_ALL=$LOCALE_JA \
+${CHECKER} ./test-mcel${EXEEXT} 4
--- /dev/null
+#!/bin/sh
+
+# Test whether a specific GB18030 locale is installed.
+: "${LOCALE_ZH_CN=zh_CN.GB18030}"
+if test $LOCALE_ZH_CN = none; then
+ if test -f /usr/bin/localedef; then
+ echo "Skipping test: no transitional chinese locale is installed"
+ else
+ echo "Skipping test: no transitional chinese locale is supported"
+ fi
+ exit 77
+fi
+
+LC_ALL=$LOCALE_ZH_CN \
+${CHECKER} ./test-mcel${EXEEXT} 5