]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/has_info_documentation.c
ccanlint: clean up test short descriptions
[ccan] / tools / ccanlint / tests / has_info_documentation.c
index 8a506aba85253596975462dd1532038d30d6e79c..4d440e6d7cec650b91d80d86e41fd0477e299f6e 100644 (file)
@@ -1,5 +1,6 @@
 #include <tools/ccanlint/ccanlint.h>
 #include <tools/doc_extract.h>
+#include <tools/tools.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -81,7 +82,7 @@ static void create_info_template_doc(struct manifest *m, void *check_result)
                unlink_noerr("_info.new");
                err(1, "Closing _info.new");
        }
-       if (rename("_info.new", "_info") != 0) {
+       if (!move_file("_info.new", "_info")) {
                unlink_noerr("_info.new");
                err(1, "Renaming _info.new to _info");
        }
@@ -122,9 +123,12 @@ static unsigned int has_info_documentation_score(struct manifest *m,
 }
 
 struct ccanlint has_info_documentation = {
-       .name = "Documentation in _info file",
+       .key = "info-documentation",
+       .name = "Module has documentation in _info",
        .total_score = 3,
        .score = has_info_documentation_score,
        .check = check_has_info_documentation,
        .describe = describe_has_info_documentation,
 };
+
+REGISTER_TEST(has_info_documentation, NULL);