* modules/fclose (configure.ac): Set module indicator. * tests/test-fclose.c (main): Use improved indicators to avoid test failure when fclose is in lib/ but fflush is in tests/.
Signed-off-by: Eric Blake <ebl...@redhat.com> --- Tested on libvirt, where fclose is in lib but fflush is in tests, as well as situations where both are in lib or both in tests. ChangeLog | 5 +++++ modules/fclose | 1 + tests/test-fclose.c | 2 +- 3 files changed, 7 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6a880d9..6e1d780 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2011-05-04 Eric Blake <ebl...@redhat.com> + test-fclose: skip part of test if fflush is not present + * modules/fclose (configure.ac): Set module indicator. + * tests/test-fclose.c (main): Use improved indicators to avoid + test failure when fclose is in lib/ but fflush is in tests/. + tests: allow tests to learn where a module is present * m4/gnulib-common.m4 (gl_MODULE_INDICATOR): Refine definition. * gnulib-tool (func_note_Makefile_am_edit): Update condition diff --git a/modules/fclose b/modules/fclose index ac383aa..c5b39b1 100644 --- a/modules/fclose +++ b/modules/fclose @@ -13,6 +13,7 @@ lseek [test $REPLACE_FCLOSE = 1] configure.ac: gl_FUNC_FCLOSE +gl_MODULE_INDICATOR([fclose]) gl_STDIO_MODULE_INDICATOR([fclose]) Makefile.am: diff --git a/tests/test-fclose.c b/tests/test-fclose.c index d9b9406..5bd0a0a 100644 --- a/tests/test-fclose.c +++ b/tests/test-fclose.c @@ -62,7 +62,7 @@ main (int argc, char **argv) ASSERT (errno == EBADF); ASSERT (lseek (fd, 0, SEEK_CUR) == 2); -#if GNULIB_FFLUSH +#if GNULIB_FFLUSH == GNULIB_FCLOSE /* Likewise for an input stream, but only when we know fflush works on input streams. */ fd2 = dup (fd); -- 1.7.4.4