From: Rusty Russell Date: Mon, 29 Aug 2011 23:56:39 +0000 (+0930) Subject: ccanlint: add is_excluded() helper. X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=b1524d16e5e98dafee5a192511a557ace0b5afb3 ccanlint: add is_excluded() helper. We'll need this in a moment. --- diff --git a/tools/ccanlint/ccanlint.c b/tools/ccanlint/ccanlint.c index 1c060ba7..5f443d6f 100644 --- a/tools/ccanlint/ccanlint.c +++ b/tools/ccanlint/ccanlint.c @@ -222,6 +222,13 @@ static struct ccanlint *find_test(const char *key) return NULL; } +bool is_excluded(const char *name) +{ + return btree_lookup(cmdline_exclude, name) != NULL + || btree_lookup(info_exclude, name) != NULL + || find_test(name)->skip != NULL; +} + #undef REGISTER_TEST #define REGISTER_TEST(name, ...) extern struct ccanlint name #include "generated-normal-tests" diff --git a/tools/ccanlint/ccanlint.h b/tools/ccanlint/ccanlint.h index c57f9203..9a83e053 100644 --- a/tools/ccanlint/ccanlint.h +++ b/tools/ccanlint/ccanlint.h @@ -237,6 +237,9 @@ struct dependent { struct ccanlint *dependent; }; +/* Is this test excluded (cmdline or _info). */ +bool is_excluded(const char *name); + /* Are we happy to compile stuff, or just non-intrusive tests? */ extern bool safe_mode;