X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fexamples_compile.c;h=8ab806438f1b4aab25e033cda63fca6915017e0c;hb=8ffd9b98c7f87177445a86e65334e5ad1d66a8af;hp=a3ab73a967e0557f567a00f02d518aa26032bcff;hpb=016a19d260cd7f4afeb5b2b2cc28c8bbed1cd170;p=ccan diff --git a/tools/ccanlint/tests/examples_compile.c b/tools/ccanlint/tests/examples_compile.c index a3ab73a9..8ab80643 100644 --- a/tools/ccanlint/tests/examples_compile.c +++ b/tools/ccanlint/tests/examples_compile.c @@ -122,6 +122,9 @@ static bool compile(const void *ctx, if (!compile_and_link(ctx, file->fullname, ccan_dir, obj_list(m, file), "", lib_list(m), file->compiled, output)) { + /* Don't keep failures. */ + if (keep) + unlink(file->compiled); talloc_free(file->compiled); file->compiled = NULL; return false; @@ -542,25 +545,23 @@ static void build_examples(struct manifest *m, bool keep, prev = lines[j]; score->score++; warnings = true; - score->error = "Compiling extracted example" - " gave warnings"; - error = talloc_asprintf(score, - "Example:\n" - "%s\n" - "Compiler:\n" - "%s", - get_ccan_file_contents(file[j]), - err[j]); - score_file_error(score, file[j], 0, error); + score_file_error(score, file[j], 0, + "Compiling extracted example" + " gave warnings:\n" + "Example:\n" + "%s\n" + "Compiler:\n" + "%s", + get_ccan_file_contents(file[j]), + err[j]); goto next; } } score->pass = false; - score->error = "Compiling extracted examples failed"; if (!verbose) { if (num == 3) - error = "Standalone, adding headers, " + error = "Compiling standalone, adding headers, " "and including previous " "example all failed"; else