X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Fcompulsory_tests%2Fcompile_test_helpers.c;h=94daaa1bf4bbe1128d234cf767e228f08bd1680b;hp=de8d4632c9fbea9aa9ff992a2b0a0eb78a879d91;hb=a200e1ad1cf5a4828ea4e4e222838ddad5a4a9a3;hpb=5f44c8ca0eb66503db51e0df1b65ff173eb42f57 diff --git a/tools/ccanlint/compulsory_tests/compile_test_helpers.c b/tools/ccanlint/compulsory_tests/compile_test_helpers.c index de8d4632..94daaa1b 100644 --- a/tools/ccanlint/compulsory_tests/compile_test_helpers.c +++ b/tools/ccanlint/compulsory_tests/compile_test_helpers.c @@ -21,24 +21,25 @@ 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; - - 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++; - cmdout = compile(m, i); + cmdout = compile(m, keep, i); if (cmdout) return talloc_asprintf(m, "Failed to compile helper C" @@ -55,7 +56,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,