X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Fccanlint.c;h=e3d99c79a7b72bda874466b48d427b5df2dad65c;hp=291a151842e0ce0d1126ae8ce6250ad68dc8dc48;hb=678cd10db6d6b81d97f3b98ea0a54657141632ad;hpb=7ce5cb9dbdff5aef2a0218539adc6e2e49c659cb diff --git a/tools/ccanlint/ccanlint.c b/tools/ccanlint/ccanlint.c index 291a1518..e3d99c79 100644 --- a/tools/ccanlint/ccanlint.c +++ b/tools/ccanlint/ccanlint.c @@ -161,9 +161,9 @@ static bool run_test(struct ccanlint *i, printf("%s%s", score->error, strends(score->error, "\n") ? "" : "\n"); } - if (!quiet && !score->pass && i->handle) - i->handle(m, score); } + if (!quiet && score->score < score->total && i->handle) + i->handle(m, score); *running_score += score->score; *running_total += score->total; @@ -584,7 +584,7 @@ static char *opt_set_const_charp(const char *arg, const char **p) int main(int argc, char *argv[]) { - bool summary = false; + bool summary = false, pass = true; unsigned int score = 0, total_score = 0; struct manifest *m; struct ccanlint *i; @@ -675,8 +675,8 @@ int main(int argc, char *argv[]) add_info_options(m->info_file, !target); while ((i = get_next_test(&normal_tests)) != NULL) - run_test(i, summary, &score, &total_score, m); + pass &= run_test(i, summary, &score, &total_score, m); printf("%sTotal score: %u/%u\n", prefix, score, total_score); - return 0; + return pass ? 0 : 1; }