Without msgfmt libc.mo files are not generated and its loading failure
is silent ignored with xsetlocale.
Also unset LANGUAGE environment variable to avoid it taking precedence
when loading the message catalog. Although not strictly required
(since the test is issued with test-container and it sets a strict
environment variable) it follows other tests that deal with
translation.
Checked on x86_64-linux-gnu.
test-endian-sign-conversion tst-memmove-overflow \
test-sig_np
-tests-container += tst-strsignal tst-strerror
+# Both tests require the .mo translation files generated by msgfmt.
+tests-translation := tst-strsignal \
+ tst-strerror
+
+tests-container += $(tests-translation)
+ifeq ($(MSGFMT),:)
+tests-unsupported += $(tests-translation)
+endif
# This test allocates a lot of memory and can run for a long time.
xtests = tst-strcoll-overflow
#include <string.h>
#include <stdio.h>
+#include <stdlib.h>
#include <errno.h>
#include <locale.h>
#include <array_length.h>
static int
do_test (void)
{
+ unsetenv ("LANGUAGE");
+
xsetlocale (LC_ALL, "C");
TEST_COMPARE_STRING (strerror (EINVAL), "Invalid argument");
#include <string.h>
#include <stdio.h>
#include <signal.h>
+#include <stdlib.h>
#include <locale.h>
#include <array_length.h>
static int
do_test (void)
{
+ unsetenv ("LANGUAGE");
+
xsetlocale (LC_ALL, "C");
TEST_COMPARE_STRING (strsignal (SIGINT), "Interrupt");