On Android (Termux app, Android API level 24, Android 11.0), I see
14 ERRORs and 29 test FAILures:

ERROR: tests/ls/ls-time
ERROR: tests/cp/attr-existing
ERROR: tests/cp/link-preserve
ERROR: tests/cp/preserve-link
ERROR: tests/dd/misc
ERROR: tests/du/inodes
ERROR: tests/ln/misc
ERROR: tests/mv/force
ERROR: tests/mv/hard-2
ERROR: tests/mv/hard-3
ERROR: tests/mv/hard-4
ERROR: tests/mv/i-link-no
ERROR: tests/mv/symlink-onto-hardlink
ERROR: tests/mv/symlink-onto-hardlink-to-self

FAIL: tests/help/help-version
FAIL: link
FAIL: ln
FAIL: tests/env/env-signal-handler
FAIL: tests/misc/close-stdout
FAIL: tests/chroot/chroot-fail
FAIL: tests/csplit/csplit
FAIL: tests/date/date-debug
FAIL: tests/groups/groups-dash
FAIL: tests/printf/printf
FAIL: tests/shred/shred-size
FAIL: tests/sort/sort-debug-warn
FAIL: tests/sort/sort-merge-fdlimit
FAIL: tests/split/l-chunk
FAIL: tests/stat/stat-fmt
FAIL: tests/tac/tac-2-nonseekable
FAIL: tests/timeout/timeout
FAIL: tests/cp/link
FAIL: tests/cp/link-deref
FAIL: tests/cp/same-file
FAIL: tests/df/df-output
FAIL: tests/du/hard-link
FAIL: tests/ln/backup-1
FAIL: tests/ln/hard-to-sym
FAIL: tests/ls/removed-directory
FAIL: tests/ls/time-style-diag
FAIL: tests/mv/childproof
FAIL: tests/mv/i-4
FAIL: tests/tail/follow-stdin

Part of the failures might be explained by the fact that in this
environment, hard links are disallowed. Instead, symlinks can be used.

Find attached the log file.

Additionally, a few of the gnulib-tests fails, one of the coming from
coreutils:


FAIL: test-mbsalign
===================

../../gnulib-tests/test-mbsalign.c:35: assertion 'n == 4' failed
Aborted
FAIL test-mbsalign (exit status: 134)


It's caused by a POSIX compliance issue in Android. Find attached
a patch that avoids this test failure.

Attachment: android-test-suite.log.gz
Description: application/gzip

From 31c7d3ae272d54badba9f432db5068d52c26dda1 Mon Sep 17 00:00:00 2001
From: Bruno Haible <br...@clisp.org>
Date: Mon, 28 Aug 2023 12:07:18 +0200
Subject: [PATCH] maint: Avoid test failure on Android

* gl/tests/test-mbsalign.c (main): Skip the unibyte truncation test
on Android, when the "C" locale in fact is multibyte.
---
 gl/tests/test-mbsalign.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/gl/tests/test-mbsalign.c b/gl/tests/test-mbsalign.c
index d7b50b470..151dbef13 100644
--- a/gl/tests/test-mbsalign.c
+++ b/gl/tests/test-mbsalign.c
@@ -29,10 +29,19 @@ main (void)
   char dest[4 * 16 + 1];
   size_t width, n;
 
-  /* Test unibyte truncation.  */
-  width = 4;
-  n = mbsalign ("t\tés", dest, sizeof dest, &width, MBS_ALIGN_LEFT, 0);
-  ASSERT (n == 4);
+#ifdef __ANDROID__
+  /* On Android ≥ 5.0, the default locale is the "C.UTF-8" locale, not the
+     "C" locale.  Furthermore, when you attempt to set the "C" or "POSIX"
+     locale via setlocale(), what you get is a "C" locale with UTF-8 encoding,
+     that is, effectively the "C.UTF-8" locale.  */
+  if (MB_CUR_MAX == 1)
+#endif
+    {
+      /* Test unibyte truncation.  */
+      width = 4;
+      n = mbsalign ("t\tés", dest, sizeof dest, &width, MBS_ALIGN_LEFT, 0);
+      ASSERT (n == 4);
+    }
 
   /* Test center alignment.  */
   width = 4;
-- 
2.34.1

Reply via email to