summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2015-06-18 13:00:01 +0930
committerRusty Russell <rusty@rustcorp.com.au>2015-06-18 13:02:09 +0930
commit04b63db616a482d6ed0f51a3ede8001415884bab (patch)
treea0cd07d546b3f216c06f1bbbaac202445e16dd75
parent5cdc505e7ec54d144c10f12a5453b7793b891e1e (diff)
ccanlint: handle circular test-depends.
eg. asort depends on order, but order testdepends on asort. Probably not the greatest thing to do, but don't barf because of it. Reported-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r--tools/ccanlint/tests/depends_exist.c5
1 files changed, 4 insertions, 1 deletions
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;