* get-rusage-data tests: Avoid test failure on musl libc
@ 2021-01-17 8:18 Bruno Haible
0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2021-01-17 8:18 UTC (permalink / raw)
To: bug-gnulib
On Alpine Linux 3.12, 3.13, I see this test failure:
FAIL: test-get-rusage-data
==========================
../../gltests/test-get-rusage-data.c:60: assertion 'value3 > value1' failed
Aborted
FAIL test-get-rusage-data (exit status: 134)
This patch fixes it.
2021-01-17 Bruno Haible <bruno@clisp.org>
get-rusage-data tests: Avoid test failure on musl libc.
* modules/get-rusage-data-tests (Files): Add m4/musl.m4.
(configure.ac): Invoke gl_MUSL_LIBC.
* tests/test-get-rusage-data.c (main): Treat musl libc like glibc.
diff --git a/modules/get-rusage-data-tests b/modules/get-rusage-data-tests
index 0b55794..109cce5 100644
--- a/modules/get-rusage-data-tests
+++ b/modules/get-rusage-data-tests
@@ -1,10 +1,12 @@
Files:
tests/test-get-rusage-data.c
tests/macros.h
+m4/musl.m4
Depends-on:
configure.ac:
+gl_MUSL_LIBC
Makefile.am:
TESTS += test-get-rusage-data
diff --git a/tests/test-get-rusage-data.c b/tests/test-get-rusage-data.c
index 229fd8c..c626540 100644
--- a/tests/test-get-rusage-data.c
+++ b/tests/test-get-rusage-data.c
@@ -55,7 +55,7 @@ main ()
ASSERT (value2 >= value1);
ASSERT (value3 >= value2);
-#if !(__GLIBC__ == 2 || (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __DragonFly__ || defined __OpenBSD__ || defined _WIN32 || defined __CYGWIN__)
+#if !(__GLIBC__ == 2 || MUSL_LIBC || (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __DragonFly__ || defined __OpenBSD__ || defined _WIN32 || defined __CYGWIN__)
/* Allocating 2.5 MB of memory should increase the data segment size. */
ASSERT (value3 > value1);
#endif
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-17 8:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-17 8:18 get-rusage-data tests: Avoid test failure on musl libc Bruno Haible
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).