X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fdepends_accurate.c;h=26943faa628a6e98fa93ab5badb9e7c67d511c20;hp=9ade3cba071b2b96f2c000b7f9a03e56a8f414f6;hb=HEAD;hpb=682b594ddb13c44fac31c07caeb287dd6bbf707b diff --git a/tools/ccanlint/tests/depends_accurate.c b/tools/ccanlint/tests/depends_accurate.c index 9ade3cba..26943faa 100644 --- a/tools/ccanlint/tests/depends_accurate.c +++ b/tools/ccanlint/tests/depends_accurate.c @@ -21,8 +21,13 @@ static bool has_dep(struct manifest *m, char **deps, bool *used, 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)) { @@ -65,7 +70,8 @@ static bool check_dep_includes(struct manifest *m, } static void check_depends_accurate(struct manifest *m, - unsigned int *timeleft, struct score *score) + unsigned int *timeleft UNNEEDED, + struct score *score) { struct list_head *list; unsigned int i, core_deps, test_deps;