From: Bruno Haible Date: Sun, 17 Jan 2021 08:17:40 +0000 (+0100) Subject: get-rusage-data tests: Avoid test failure on musl libc. X-Git-Tag: v1.0~3154 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=2e9b9370bcc74dc88b35cb761ae15db72401add2;p=gnulib.git 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/ChangeLog b/ChangeLog index 61d1e98364..cb9037d282 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2021-01-17 Bruno Haible + + 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. + 2021-01-17 Bruno Haible immutable, get-rusage-data: Fix autoconf warning. diff --git a/modules/get-rusage-data-tests b/modules/get-rusage-data-tests index 0b55794302..109cce53e9 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 229fd8c5a2..c626540a32 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