From b1524d16e5e98dafee5a192511a557ace0b5afb3 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 30 Aug 2011 09:26:39 +0930 Subject: [PATCH] ccanlint: add is_excluded() helper. We'll need this in a moment. --- tools/ccanlint/ccanlint.c | 7 +++++++ tools/ccanlint/ccanlint.h | 3 +++ 2 files changed, 10 insertions(+) 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; -- 2.39.2