From 39a489fa27ab3873e0fc0f65844413f46fcb2117 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 11 Nov 2011 14:37:59 +0100 Subject: [PATCH] test-exclude: skip tests rather than failing on deficient systems * tests/test-exclude.c (main): Skip tests that use FNM_CASEFOLD and FNM_LEADING_DIR on systems that lack the definitions. This affects at least Solaris 9. Reported and diagnosed by Dagobert Michelsen in http://thread.gmane.org/gmane.comp.gnu.grep.bugs/3947/focus=3950 --- ChangeLog | 8 ++++++++ tests/test-exclude.c | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0c4eff930..d35f6c6f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-11-11 Jim Meyering + + test-exclude: skip tests rather than failing on deficient systems + * tests/test-exclude.c (main): Skip tests that use FNM_CASEFOLD + and FNM_LEADING_DIR on systems that lack the definitions. This affects + at least Solaris 9. Reported and diagnosed by Dagobert Michelsen in + http://thread.gmane.org/gmane.comp.gnu.grep.bugs/3947/focus=3950 + 2011-11-10 Bruno Haible ptsname_r test: Avoid gcc warning on glibc systems. diff --git a/tests/test-exclude.c b/tests/test-exclude.c index 9c7997d97..47392d9b7 100644 --- a/tests/test-exclude.c +++ b/tests/test-exclude.c @@ -104,6 +104,15 @@ main (int argc, char **argv) exclude_options &= ~flag; else exclude_options |= flag; + + /* Skip this test if invoked with -leading-dir on a system that + lacks support for FNM_LEADING_DIR. */ + if (strcmp (s, "leading-dir") == 0 && FNM_LEADING_DIR == 0) + exit (77); + + /* Likewise for -casefold and FNM_CASEFOLD. */ + if (strcmp (s, "casefold") == 0 && FNM_CASEFOLD == 0) + exit (77); } else if (add_exclude_file (add_exclude, exclude, opt, exclude_options, '\n') != 0) -- 2.11.0