ccanlint: add is_excluded() helper.
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 29 Aug 2011 23:56:39 +0000 (09:26 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 29 Aug 2011 23:56:39 +0000 (09:26 +0930)
We'll need this in a moment.

tools/ccanlint/ccanlint.c
tools/ccanlint/ccanlint.h

index 1c060ba7db6bf61147a8716e47dafe63c130d509..5f443d6fafd4ec4f9cbea5b62ebf054be0d92a98 100644 (file)
@@ -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"
index c57f92037c6ba3a8197c8c48e102369f31db8dcd..9a83e053de451d268a8887121d66e9d92faec163 100644 (file)
@@ -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;