X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Fcompulsory_tests%2Fcompile_test_helpers.c;h=ac29aa3cd2799ed55bb24281fc0414b89df8815e;hp=fc88b1b0e7bca75b429256d59773354b5831b92f;hb=fb4c4c3ddc24772f71a64ec02d2c9ddaeb6e9f6b;hpb=747a69435d9f83c0968d9689c4951bc0233ffc5e diff --git a/tools/ccanlint/compulsory_tests/compile_test_helpers.c b/tools/ccanlint/compulsory_tests/compile_test_helpers.c index fc88b1b0..ac29aa3c 100644 --- a/tools/ccanlint/compulsory_tests/compile_test_helpers.c +++ b/tools/ccanlint/compulsory_tests/compile_test_helpers.c @@ -21,25 +21,24 @@ static const char *can_build(struct manifest *m) 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; - char *fullfile = talloc_asprintf(m, "%s/%s", m->dir, cfile->name); - - cfile->compiled = compile_object(m, fullfile, ccan_dir, &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++; - cmdout = compile(m, i); + cmdout = compile(m, keep, i); if (cmdout) return talloc_asprintf(m, "Failed to compile helper C" @@ -56,7 +55,8 @@ static const char *describe_compile_test_helpers(struct manifest *m, } 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,