X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Fcompulsory_tests%2Fdepends_exist.c;h=b1694058b632c18ea54d58a9b028d39768f7ea4e;hp=c283f2a4b11b7b3919c60504ef452b9daded22da;hb=4c5ed661c625ac2638a18f9540ff5b9f96a6ba6f;hpb=b931f4765272d68de3b5e35d70c1933c27bcdea4;ds=sidebyside diff --git a/tools/ccanlint/compulsory_tests/depends_exist.c b/tools/ccanlint/compulsory_tests/depends_exist.c index c283f2a4..b1694058 100644 --- a/tools/ccanlint/compulsory_tests/depends_exist.c +++ b/tools/ccanlint/compulsory_tests/depends_exist.c @@ -41,10 +41,20 @@ static void check_depends_exist(struct manifest *m, unsigned int i; char **deps; char *updir = talloc_strdup(m, m->dir); + bool needs_tap; if (strrchr(updir, '/')) *strrchr(updir, '/') = '\0'; + /* We may need libtap for testing, unless we're "tap" */ + if (streq(m->basename, "tap")) { + needs_tap = false; + } else if (list_empty(&m->run_tests) && list_empty(&m->api_tests)) { + needs_tap = false; + } else { + needs_tap = true; + } + if (safe_mode) deps = get_safe_ccan_deps(m, m->dir, true); else @@ -57,13 +67,14 @@ static void check_depends_exist(struct manifest *m, if (!add_dep(m, deps[i], score)) return; + + if (streq(deps[i], "ccan/tap")) { + needs_tap = false; + } } - /* We may need libtap for testing, unless we're "tap" */ - if (!streq(m->basename, "tap") - && (!list_empty(&m->run_tests) || !list_empty(&m->api_tests))) { - if (!add_dep(m, "ccan/tap", score)) - return; + if (needs_tap && !add_dep(m, "ccan/tap", score)) { + return; } score->pass = true;