On Android compiling a testdir in termux results in test-glob failing
with the following:
$ ./gltests/test-glob
test-glob.c:118: assertion 'res == 0' failed
Aborted ./gltests/test-glob
I think this is because the shell is at /system/bin/sh instead of
/bin/sh.
How about accepting GLOB_NOMATCH in this case? Since the main purpose of
this test is to catch the glibc stack overflow.
Collin
>From 25e817eab9689c906c1e661dd4153513f39343e3 Mon Sep 17 00:00:00 2001
Message-ID: <25e817eab9689c906c1e661dd4153513f39343e3.1760955733.git.collin.fu...@gmail.com>
From: Collin Funk <[email protected]>
Date: Mon, 20 Oct 2025 03:20:58 -0700
Subject: [PATCH] glob tests: Don't assume /bin/sh exists.
* tests/test-glob.c (main): Also allow glob to return GLOB_NOMATCH for
this test case.
---
ChangeLog | 6 ++++++
tests/test-glob.c | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 99e2df6f2a..f8691ffae4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-10-20 Collin Funk <[email protected]>
+
+ glob tests: Don't assume /bin/sh exists.
+ * tests/test-glob.c (main): Also allow glob to return GLOB_NOMATCH for
+ this test case.
+
2025-10-20 Bruno Haible <[email protected]>
gnulib-tool.sh: Trivial simplification.
diff --git a/tests/test-glob.c b/tests/test-glob.c
index 23dda01291..f8f8d3ee46 100644
--- a/tests/test-glob.c
+++ b/tests/test-glob.c
@@ -115,7 +115,7 @@ main ()
pattern[1] = '*';
strcpy (pattern + 9997, "sh");
res = glob (pattern, 0, NULL, &g);
- ASSERT (res == 0);
+ ASSERT (res == 0 || res == GLOB_NOMATCH);
globfree (&g);
free (pattern);
--
2.51.0