]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/compulsory_tests/compile_test_helpers.c
ccanlint: Add -k option to keep results.
[ccan] / tools / ccanlint / compulsory_tests / compile_test_helpers.c
index de8d4632c9fbea9aa9ff992a2b0a0eb78a879d91..ac29aa3cd2799ed55bb24281fc0414b89df8815e 100644 (file)
@@ -21,24 +21,24 @@ static const char *can_build(struct manifest *m)
        return NULL;
 }
 
        return NULL;
 }
 
-static char *compile(struct manifest *m, struct ccan_file *cfile)
+static char *compile(struct manifest *m, 
+                    bool keep,
+                    struct ccan_file *cfile)
 {
 {
-       char *err;
-
-       cfile->compiled = compile_object(m, cfile->name, &err);
-       if (cfile->compiled)
-               return NULL;
-       return err;
+       cfile->compiled = maybe_temp_file(m, "", keep, cfile->fullname);
+       return compile_object(m, cfile->fullname, ccan_dir, cfile->compiled);
 }
 
 }
 
-static void *do_compile_test_helpers(struct manifest *m)
+static void *do_compile_test_helpers(struct manifest *m,
+                                    bool keep,
+                                    unsigned int *timeleft)
 {
        char *cmdout = NULL;
        struct ccan_file *i;
 
        list_for_each(&m->other_test_c_files, i, list) {
                compile_tests.total_score++;
 {
        char *cmdout = NULL;
        struct ccan_file *i;
 
        list_for_each(&m->other_test_c_files, i, list) {
                compile_tests.total_score++;
-               cmdout = compile(m, i);
+               cmdout = compile(m, keep, i);
                if (cmdout)
                        return talloc_asprintf(m,
                                               "Failed to compile helper C"
                if (cmdout)
                        return talloc_asprintf(m,
                                               "Failed to compile helper C"
@@ -55,7 +55,8 @@ static const char *describe_compile_test_helpers(struct manifest *m,
 }
 
 struct ccanlint compile_test_helpers = {
 }
 
 struct ccanlint compile_test_helpers = {
-       .name = "Compiling test helper files",
+       .key = "compile-helpers",
+       .name = "Module test helper objects compile",
        .total_score = 1,
        .check = do_compile_test_helpers,
        .describe = describe_compile_test_helpers,
        .total_score = 1,
        .check = do_compile_test_helpers,
        .describe = describe_compile_test_helpers,