]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/depends_exist.c
a_star: new module added to hacky Makefile-ccan list.
[ccan] / tools / ccanlint / tests / depends_exist.c
index f69a08e432b4a91951f79c23735c11a1705e384b..f4d1e964634c8210cbf8fb6893ef5f4a4b2403ef 100644 (file)
@@ -63,8 +63,10 @@ static void check_depends_exist(struct manifest *m,
        }
 
        for (i = 0; deps[i]; i++) {
-               if (!strstarts(deps[i], "ccan/"))
+               if (!strstarts(deps[i], "ccan/")) {
+                       non_ccan_deps = true;
                        continue;
+               }
 
                if (!add_dep(m, &m->deps, deps[i], score))
                        return;
@@ -101,8 +103,11 @@ static void check_test_depends_exist(struct manifest *m,
                if (!strstarts(deps[i], "ccan/"))
                        continue;
 
-               /* Don't add dependency twice: we can only be on one list! */
+               /* Don't add dependency twice: we can only be on one list!
+                * Also, it's possible to have circular test depends, so drop
+                * self-refs. */
                if (!have_dep(m, deps[i])
+                   && !streq(deps[i] + strlen("ccan/"), m->modname)
                    && !add_dep(m, &m->test_deps, deps[i], score))
                        return;