X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fdepends_exist.c;h=50f154221f3bb46e931da8d845b768a9c4f025b7;hp=09c187e98f54ccefb01c6072be479fce72784d93;hb=HEAD;hpb=99293863b4ee74e49c067aa3bd63b9d5cb109141 diff --git a/tools/ccanlint/tests/depends_exist.c b/tools/ccanlint/tests/depends_exist.c index 09c187e9..50f15422 100644 --- a/tools/ccanlint/tests/depends_exist.c +++ b/tools/ccanlint/tests/depends_exist.c @@ -46,7 +46,8 @@ static bool add_dep(struct manifest *m, /* FIXME: check this is still true once we reduce features. */ static void check_depends_exist(struct manifest *m, - unsigned int *timeleft, struct score *score) + unsigned int *timeleft UNNEEDED, + struct score *score) { unsigned int i; char **deps; @@ -77,7 +78,7 @@ static void check_depends_exist(struct manifest *m, } static void check_test_depends_exist(struct manifest *m, - unsigned int *timeleft, + unsigned int *timeleft UNNEEDED, struct score *score) { unsigned int i; @@ -103,8 +104,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; @@ -127,7 +131,7 @@ struct ccanlint depends_exist = { .name = "Module's CCAN dependencies can be found", .compulsory = true, .check = check_depends_exist, - .needs = "info_exists" + .needs = "info_compiles" }; REGISTER_TEST(depends_exist);