X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fdepends_accurate.c;h=943fa350e09b3a8d6bc8ffc10c990f3e12e4a8d7;hp=3ba19f60a3240e0385dd720b509887bd4e4b493e;hb=451d97ad85e65061223f04dceaca0454c7b2201a;hpb=04b2feefda59d3193ef500bfc8ea12ec4a4c0b55 diff --git a/tools/ccanlint/tests/depends_accurate.c b/tools/ccanlint/tests/depends_accurate.c index 3ba19f60..943fa350 100644 --- a/tools/ccanlint/tests/depends_accurate.c +++ b/tools/ccanlint/tests/depends_accurate.c @@ -28,19 +28,16 @@ static char *strip_spaces(const void *ctx, char *line) return p; } -static bool has_dep(struct manifest *m, const char *depname, bool tap_ok) +static bool has_dep(struct manifest *m, const char *depname) { - struct ccan_file *f; - - if (tap_ok && streq(depname, "ccan/tap")) - return true; + struct manifest *i; /* We can include ourselves, of course. */ - if (streq(depname + strlen("ccan/"), m->basename)) + if (streq(depname, m->basename)) return true; - list_for_each(&m->dep_dirs, f, list) { - if (streq(f->name, depname)) + list_for_each(&m->deps, i, list) { + if (streq(i->basename, depname)) return true; } return false; @@ -57,10 +54,6 @@ static void check_depends_accurate(struct manifest *m, &m->compile_ok_tests, &m->compile_fail_tests, &m->other_test_c_files) { struct ccan_file *f; - bool tap_ok; - - /* Including ccan/tap is fine for tests. */ - tap_ok = (list != &m->c_files && list != &m->h_files); list_for_each(list, f, list) { unsigned int i; @@ -74,11 +67,11 @@ static void check_depends_accurate(struct manifest *m, if (!strstarts(p, "#includeerror = "Includes a ccan module" " not listed in _info";