unsigned int i;
/* We can include ourselves, of course. */
- if (streq(depname + strlen("ccan/"), m->modname))
- return true;
+ if (strstarts(depname + strlen("ccan/"), m->modname)) {
+ const char *p = depname + strlen("ccan/") + strlen(m->modname);
+ /* And our own tests! */
+ if (streq(p, "/test") || streq(p, ""))
+ return true;
+ /* But not any submodules; they need an explicit dep */
+ }
for (i = 0; deps[i]; i++) {
if (streq(deps[i], depname)) {
char *mod;
if (!tal_strreg(f, lines[i],
"^[ \t]*#[ \t]*include[ \t]*[<\"]"
- "(ccan/+.+)/+[^/]+\\.h", &mod))
+ "(ccan/+.+)/+[^/]+\\.[ch][\">]", &mod))
continue;
if (has_dep(m, deps, used, mod))