]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/main_header_compiles.c
ccanlint: make _info ported an empty string on success.
[ccan] / tools / ccanlint / tests / main_header_compiles.c
index b4a12e1349297a4330f2cae800c6d580e517232a..f54c6173a53578e76c6e805cf281ef7319a6c19a 100644 (file)
@@ -1,7 +1,5 @@
 #include <tools/ccanlint/ccanlint.h>
 #include <tools/tools.h>
-#include <ccan/talloc/talloc.h>
-#include <ccan/grab_file/grab_file.h>
 #include <ccan/str/str.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -50,8 +48,8 @@ static void check_includes_build(struct manifest *m,
        if (fd < 0)
                err(1, "Creating temporary file %s", tmpsrc);
 
-       contents = talloc_asprintf(tmpsrc, "#include <ccan/%s/%s.h>\n",
-                                  m->basename, m->basename);
+       contents = tal_fmt(tmpsrc, "#include <ccan/%s/%s.h>\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 +59,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 +70,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);