X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fmain_header_compiles.c;h=1b741d4fd7c5c4b7aa0d77694023f42d4db04f35;hb=d872b7f22bc98092cad2aa4a456973bdbdb2c8fb;hp=b4a12e1349297a4330f2cae800c6d580e517232a;hpb=af5b1a18948345c5f9f9abf4eda3ab9fe0aa9a9f;p=ccan diff --git a/tools/ccanlint/tests/main_header_compiles.c b/tools/ccanlint/tests/main_header_compiles.c index b4a12e13..1b741d4f 100644 --- a/tools/ccanlint/tests/main_header_compiles.c +++ b/tools/ccanlint/tests/main_header_compiles.c @@ -1,7 +1,5 @@ #include #include -#include -#include #include #include #include @@ -15,7 +13,7 @@ #include #include -static const char *can_build(struct manifest *m) +static const char *can_build(struct manifest *m UNNEEDED) { if (safe_mode) return "Safe mode enabled"; @@ -36,7 +34,8 @@ static struct ccan_file *main_header(struct manifest *m) } static void check_includes_build(struct manifest *m, - unsigned int *timeleft, struct score *score) + unsigned int *timeleft UNNEEDED, + struct score *score) { char *contents; char *tmpsrc, *tmpobj, *cmdout; @@ -50,8 +49,8 @@ static void check_includes_build(struct manifest *m, if (fd < 0) err(1, "Creating temporary file %s", tmpsrc); - contents = talloc_asprintf(tmpsrc, "#include \n", - m->basename, m->basename); + contents = tal_fmt(tmpsrc, "#include \n", + m->modname, m->basename); if (write(fd, contents, strlen(contents)) != strlen(contents)) err(1, "writing to temporary file %s", tmpsrc); close(fd); @@ -61,7 +60,7 @@ static void check_includes_build(struct manifest *m, score->pass = true; score->score = score->total; } else { - score->error = talloc_asprintf(score, + score->error = tal_fmt(score, "#include of the main header file:\n%s", cmdout); } @@ -72,7 +71,7 @@ struct ccanlint main_header_compiles = { .name = "Modules main header compiles", .check = check_includes_build, .can_run = can_build, - .needs = "depends_exist main_header_exists" + .needs = "depends_exist main_header_exists info_ported" }; REGISTER_TEST(main_header_compiles);