[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/2] test-fclose: skip part of test if fflush is not present
From: |
Eric Blake |
Subject: |
[PATCH 2/2] test-fclose: skip part of test if fflush is not present |
Date: |
Wed, 4 May 2011 16:39:49 -0600 |
* 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 <address@hidden>
---
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 <address@hidden>
+ 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
- gl_MODULE_INDICATOR, Eric Blake, 2011/05/04
- [PATCH 1/2] tests: allow tests to learn where a module is present, Eric Blake, 2011/05/04
- Re: gl_MODULE_INDICATOR, Bruno Haible, 2011/05/05
- Re: gl_MODULE_INDICATOR, Eric Blake, 2011/05/05
- Re: two semantics of fclose(), Bruno Haible, 2011/05/05
- Re: two semantics of fclose(), Eric Blake, 2011/05/05
- Re: two semantics of fclose(), Jim Meyering, 2011/05/06
- Re: two semantics of fclose(), Bruno Haible, 2011/05/06
- [PATCH] fclose: guarantee behavior on seekable stdin, Eric Blake, 2011/05/06
- Re: [PATCH] fclose: guarantee behavior on seekable stdin, Bruno Haible, 2011/05/06
- Re: [PATCH] fclose: guarantee behavior on seekable stdin, Bruno Haible, 2011/05/07