}
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;
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;