Commit 39323f37 authored by Rusty Russell's avatar Rusty Russell

ccanlint: fix scoring, add score details to --verbose.

parent 1f2fc897
......@@ -119,8 +119,13 @@ static bool run_test(struct ccanlint *i,
result = i->check(m);
if (!result) {
if (verbose)
printf(" %s: OK\n", i->name);
if (verbose) {
printf(" %s: OK", i->name);
if (i->total_score)
printf(" (+%u/%u)",
i->total_score, i->total_score);
printf("\n");
}
if (i->total_score) {
*score += i->total_score;
*total_score += i->total_score;
......@@ -141,6 +146,10 @@ static bool run_test(struct ccanlint *i,
*total_score += i->total_score;
*score += this_score;
if (verbose) {
printf(" %s: FAIL (+%u/%u)\n",
i->name, this_score, i->total_score);
}
if (!quiet) {
printf("%s\n", i->describe(m, result));
......
......@@ -49,7 +49,7 @@ static void *do_run_tests_vg(struct manifest *m)
list_head_init(list);
list_for_each(&m->run_tests, i, list) {
run_tests.total_score++;
run_tests_vg.total_score++;
/* FIXME: timeout here */
cmdout = run_command(m, "valgrind -q %s", i->compiled);
if (cmdout) {
......@@ -61,7 +61,7 @@ static void *do_run_tests_vg(struct manifest *m)
}
list_for_each(&m->api_tests, i, list) {
run_tests.total_score++;
run_tests_vg.total_score++;
/* FIXME: timeout here */
cmdout = run_command(m, "valgrind -q %s", i->compiled);
if (cmdout) {
......@@ -87,7 +87,7 @@ static unsigned int score_run_tests_vg(struct manifest *m, void *check_result)
{
struct list_head *list = check_result;
struct run_tests_result *i;
unsigned int score = run_tests.total_score;
unsigned int score = run_tests_vg.total_score;
list_for_each(list, i, list)
score--;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment