Files
gnulib/tests/test-nstrftime-2.sh
Bruno Haible de57613d99 nstrftime: Add tests of all directives, also in non-trivial locales.
* tests/test-nstrftime.h (language_t): New type.
(locales_test): New function.
* tests/test-nstrftime.c: Include <locale.h>, <stdlib.h>.
(main): Invoke setlocale and locales_test.
* tests/test-nstrftime-1.sh: New file.
* tests/test-nstrftime-2.sh: New file, based on tests/test-strtod1.sh.
* modules/nstrftime-tests (Files): Add them. Add m4/locale-fr.m4,
m4/codeset.m4, m4/musl.m4.
(configure.ac): Invoke gt_LOCALE_FR, gt_LOCALE_FR_UTF8, gl_MUSL_LIBC.
(Makefile.am): Link test-nstrftime with $(SETLOCALE_LIB). Test
test-nstrftime-*.sh instead of test-nstrftime.
2024-02-07 23:53:09 +01:00

42 lines
764 B
Bash
Executable File

#!/bin/sh
: "${LOCALE_FR=fr_FR}"
: "${LOCALE_FR_UTF8=fr_FR.UTF-8}"
if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
if test -f /usr/bin/localedef; then
echo "Skipping test: no locale for testing is installed"
else
echo "Skipping test: no locale for testing is supported"
fi
exit 77
fi
final_rc=0
if test $LOCALE_FR != none; then
LC_ALL=$LOCALE_FR ${CHECKER} ./test-nstrftime${EXEEXT}
rc=$?
if test $rc = 77; then
final_rc=77
else
if test $rc != 0; then
exit 1
fi
fi
fi
if test $LOCALE_FR_UTF8 != none; then
LC_ALL=$LOCALE_FR_UTF8 ${CHECKER} ./test-nstrftime${EXEEXT}
rc=$?
if test $rc = 77; then
final_rc=77
else
if test $rc != 0; then
exit 1
fi
fi
fi
exit $final_rc