X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=tools%2Fccanlint%2Fccanlint.c;h=e2a687e06c410751996235e82192405726baa654;hb=becfc7c324d821fe135a1ad843c596399ed5068a;hp=89e0b5c61237751d8fbd6a85c2987694d3a1d02e;hpb=99293863b4ee74e49c067aa3bd63b9d5cb109141;p=ccan diff --git a/tools/ccanlint/ccanlint.c b/tools/ccanlint/ccanlint.c index 89e0b5c6..e2a687e0 100644 --- a/tools/ccanlint/ccanlint.c +++ b/tools/ccanlint/ccanlint.c @@ -35,12 +35,10 @@ #include #include -struct ccanlint_map { - STRMAP_MEMBERS(struct ccanlint *); -}; +typedef STRMAP(struct ccanlint *) ccanlint_map_t; int verbose = 0; -static struct ccanlint_map tests; +static ccanlint_map_t tests; bool safe_mode = false; bool keep_results = false; bool non_ccan_deps = false; @@ -273,7 +271,7 @@ static bool init_deps(const char *member, struct ccanlint *c, void *unused) } static bool check_names(const char *member, struct ccanlint *c, - struct ccanlint_map *names) + ccanlint_map_t *names) { if (!strmap_add(names, c->name, c)) err(1, "Duplicate name %s", c->name); @@ -282,7 +280,7 @@ static bool check_names(const char *member, struct ccanlint *c, static void init_tests(void) { - struct ccanlint_map names; + ccanlint_map_t names; struct ccanlint **table; size_t i, num; @@ -579,6 +577,8 @@ static bool run_tests(struct dgraph_node *all, if (deps_fail_ignore && non_ccan_deps && build_failed) { comment = " (missing non-ccan dependencies?)"; run.pass = true; + } else if (!run.pass) { + comment = " FAIL!"; } printf("%sTotal score: %u/%u%s\n", prefix, run.score, run.total, comment); @@ -679,7 +679,7 @@ int main(int argc, char *argv[]) if (argc == 1) dir = cwd; else - dir = path_join(NULL, cwd, argv[1]); + dir = path_simplify(NULL, take(path_join(NULL, cwd, argv[1]))); ccan_dir = find_ccan_dir(dir); if (!ccan_dir)