]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/compulsory_tests/check_depends_built.c
ccanlint: Add -k option to keep results.
[ccan] / tools / ccanlint / compulsory_tests / check_depends_built.c
index 854f4bc8fe40443cc86bed5b30f3519281218ab9..04ef54eb2c79a0060d5b0a43982653b4c671004a 100644 (file)
@@ -35,28 +35,25 @@ static bool expect_obj_file(const char *dir)
        return has_c_files;
 }
 
        return has_c_files;
 }
 
-static void *check_depends_built(struct manifest *m)
+static void *check_depends_built(struct manifest *m,
+                                bool keep,
+                                unsigned int *timeleft)
 {
        struct ccan_file *i;
        struct stat st;
        char *report = NULL;
 
        list_for_each(&m->dep_dirs, i, list) {
 {
        struct ccan_file *i;
        struct stat st;
        char *report = NULL;
 
        list_for_each(&m->dep_dirs, i, list) {
-               char *objfile;
-
                if (!expect_obj_file(i->fullname))
                        continue;
 
                if (!expect_obj_file(i->fullname))
                        continue;
 
-               objfile = talloc_asprintf(m, "%s.o", i->fullname);
-               if (stat(objfile, &st) != 0) {
+               i->compiled = talloc_asprintf(i, "%s.o", i->fullname);
+               if (stat(i->compiled, &st) != 0) {
                        report = talloc_asprintf_append(report,
                                                        "object file %s\n",
                        report = talloc_asprintf_append(report,
                                                        "object file %s\n",
-                                                       objfile);
-               } else {
-                       struct ccan_file *f = new_ccan_file(m, "", objfile);
-                       list_add_tail(&m->dep_objs, &f->list);
-               }
-                       
+                                                       i->compiled);
+                       i->compiled = NULL;
+               }                       
        }
 
        /* We may need libtap for testing, unless we're "tap" */
        }
 
        /* We may need libtap for testing, unless we're "tap" */
@@ -84,7 +81,7 @@ static const char *describe_depends_built(struct manifest *m,
 
 struct ccanlint depends_built = {
        .key = "depends-built",
 
 struct ccanlint depends_built = {
        .key = "depends-built",
-       .name = "CCAN dependencies are built",
+       .name = "Module's CCAN dependencies are already built",
        .total_score = 1,
        .check = check_depends_built,
        .describe = describe_depends_built,
        .total_score = 1,
        .check = check_depends_built,
        .describe = describe_depends_built,