X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;ds=inline;f=tools%2Fccanlint%2Ftests%2Finfo_exists.c;h=5e4459bcbe02d362213bcf35e99a33c37c14f175;hb=615189ae6de685ae6eb5a19b877340d731bba747;hp=80edb5aa911b25c868407d3114e97fce44f63bc3;hpb=60824f8a0f758dc7808eb31cc83434ea78f44ed1;p=ccan diff --git a/tools/ccanlint/tests/info_exists.c b/tools/ccanlint/tests/info_exists.c index 80edb5aa..5e4459bc 100644 --- a/tools/ccanlint/tests/info_exists.c +++ b/tools/ccanlint/tests/info_exists.c @@ -1,4 +1,6 @@ #include +#include +#include #include #include #include @@ -10,18 +12,17 @@ #include #include #include -#include static void check_has_info(struct manifest *m, - bool keep, - unsigned int *timeleft, + unsigned int *timeleft UNNEEDED, struct score *score) { if (m->info_file) { score->pass = true; score->score = score->total; + add_info_options(m->info_file); } else { - score->error = talloc_strdup(score, + score->error = tal_strdup(score, "You have no _info file.\n\n" "The file _info contains the metadata for a ccan package: things\n" "like the dependencies, the documentation for the package as a whole\n" @@ -30,8 +31,9 @@ static void check_has_info(struct manifest *m, } static const char template[] = - "#include \n" "#include \"config.h\"\n" + "#include \n" + "#include \n" "\n" "/**\n" " * %s - YOUR-ONE-LINE-DESCRIPTION-HERE\n" @@ -55,7 +57,8 @@ static const char template[] = " return 1;\n" "}\n"; -static void create_info_template(struct manifest *m, struct score *score) +static void create_info_template(struct manifest *m, + struct score *score UNNEEDED) { FILE *info; const char *filename; @@ -63,12 +66,12 @@ static void create_info_template(struct manifest *m, struct score *score) if (!ask("Should I create a template _info file for you?")) return; - filename = talloc_asprintf(m, "%s/%s", m->dir, "_info"); + filename = tal_fmt(m, "%s/%s", m->dir, "_info"); info = fopen(filename, "w"); if (!info) err(1, "Trying to create a template _info in %s", filename); - if (fprintf(info, template, m->basename) < 0) { + if (fprintf(info, template, m->modname) < 0) { unlink_noerr(filename); err(1, "Writing template into %s", filename); }