Browse Source

ccanlint: add is_excluded() helper.

We'll need this in a moment.
Rusty Russell 14 years ago
parent
commit
b1524d16e5
2 changed files with 10 additions and 0 deletions
  1. 7 0
      tools/ccanlint/ccanlint.c
  2. 3 0
      tools/ccanlint/ccanlint.h

+ 7 - 0
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"

+ 3 - 0
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;