X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fdepends_exist.c;fp=tools%2Fccanlint%2Ftests%2Fdepends_exist.c;h=f4d1e964634c8210cbf8fb6893ef5f4a4b2403ef;hp=09c187e98f54ccefb01c6072be479fce72784d93;hb=04b63db616a482d6ed0f51a3ede8001415884bab;hpb=5cdc505e7ec54d144c10f12a5453b7793b891e1e diff --git a/tools/ccanlint/tests/depends_exist.c b/tools/ccanlint/tests/depends_exist.c index 09c187e9..f4d1e964 100644 --- a/tools/ccanlint/tests/depends_exist.c +++ b/tools/ccanlint/tests/depends_exist.c @@ -103,8 +103,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;