X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fexamples_exist.c;h=847010af5f43ff0df075f583bcdfaf9bd5a926ce;hp=947d76a4a768751053e6830b4bb788cb2c56df77;hb=4786b6edb824262957bfd5e7cff74c1e3983a9c9;hpb=051db34fb275491d4d5dfa5bf7970e8e525766d8 diff --git a/tools/ccanlint/tests/examples_exist.c b/tools/ccanlint/tests/examples_exist.c index 947d76a4..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,21 +94,19 @@ 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; } - score->error = "Expect examples in header and _info"; if (!have_info_example) score_file_error(score, m->info_file, 0, "No Example: section"); if (!have_header_example) 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 = {