X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fdepends_accurate.c;h=986fb3bcc398df429e3b09d05cd081dc22e9d039;hb=bbb4aa72f0a087b3a1441e912ccac576c907e618;hp=34db4f84d0dd75b9d402f7ead9bc798cdf88268b;hpb=73650a939e3abdf495fd3ca6bd5fea695e28a089;p=ccan diff --git a/tools/ccanlint/tests/depends_accurate.c b/tools/ccanlint/tests/depends_accurate.c index 34db4f84..986fb3bc 100644 --- a/tools/ccanlint/tests/depends_accurate.c +++ b/tools/ccanlint/tests/depends_accurate.c @@ -32,7 +32,6 @@ static bool has_dep(struct manifest *m, const char *depname) } static void check_depends_accurate(struct manifest *m, - bool keep, unsigned int *timeleft, struct score *score) { struct list_head *list; @@ -46,6 +45,7 @@ static void check_depends_accurate(struct manifest *m, list_for_each(list, f, list) { unsigned int i; char **lines = get_ccan_file_lines(f); + struct line_info *li = get_ccan_line_info(f); for (i = 0; lines[i]; i++) { char *mod; @@ -53,18 +53,25 @@ static void check_depends_accurate(struct manifest *m, "^[ \t]*#[ \t]*include[ \t]*[<\"]" "ccan/+([^/]+)/", &mod)) continue; + if (has_dep(m, mod)) continue; - score->error = "Includes a ccan module" - " not listed in _info"; - score_file_error(score, f, i+1, lines[i]); + + /* FIXME: we can't be sure about + * conditional includes, so don't + * complain. */ + if (!li[i].cond) { + score_file_error(score, f, i+1, + "%s not listed in _info", + mod); + } } } } if (!score->error) { - score->pass = true; score->score = score->total; + score->pass = true; } }