X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fexamples_exist.c;h=847010af5f43ff0df075f583bcdfaf9bd5a926ce;hp=2091f67f0f97c82218b57d77a380ee3528eedc4f;hb=8de1e8a6faef77773cbf8ed237eb4e330143d2f2;hpb=7bb7cd58c2d9df126dd6072e5f3bec1eb4dc916b diff --git a/tools/ccanlint/tests/examples_exist.c b/tools/ccanlint/tests/examples_exist.c index 2091f67f..847010af 100644 --- a/tools/ccanlint/tests/examples_exist.c +++ b/tools/ccanlint/tests/examples_exist.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -48,7 +49,8 @@ static char *add_example(struct manifest *m, struct ccan_file *source, != strlen(example->lines[i]) || write(fd, "\n", 1) != 1) { close(fd); - return "Failure writing to temporary file"; + return cast_const(char *, + "Failure writing to temporary file"); } } close(fd); @@ -92,9 +94,10 @@ static void extract_examples(struct manifest *m, } } + /* We don't fail ccanlint for this. */ + score->pass = true; if (have_info_example && have_header_example) { score->score = score->total; - score->pass = true; return; } @@ -104,8 +107,6 @@ static void extract_examples(struct manifest *m, score_file_error(score, mainh, 0, "No Example: section"); score->score = have_info_example + have_header_example; - /* We pass if we find any example. */ - score->pass = score->score != 0; } struct ccanlint examples_exist = {