X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fobjects_build.c;h=d44b7e7464fd2410071697570fa9267a7de541bb;hb=79ac0049672b1f27b1a7121d06cc38721f76b8e1;hp=8fc11266be6cef94199f4ef30e4de92bf47a6805;hpb=60824f8a0f758dc7808eb31cc83434ea78f44ed1;p=ccan diff --git a/tools/ccanlint/tests/objects_build.c b/tools/ccanlint/tests/objects_build.c index 8fc11266..d44b7e74 100644 --- a/tools/ccanlint/tests/objects_build.c +++ b/tools/ccanlint/tests/objects_build.c @@ -1,7 +1,7 @@ #include #include -#include #include +#include #include #include #include @@ -23,7 +23,7 @@ static const char *can_build(struct manifest *m) } void build_objects(struct manifest *m, - bool keep, struct score *score, const char *flags, + struct score *score, const char *flags, enum compile_type ctype) { struct ccan_file *i; @@ -36,12 +36,12 @@ void build_objects(struct manifest *m, list_for_each(&m->c_files, i, list) { char *output; - char *fullfile = talloc_asprintf(m, "%s/%s", m->dir, i->name); + char *fullfile = path_join(m, m->dir, i->name); - i->compiled[ctype] = maybe_temp_file(m, "", keep, fullfile); + i->compiled[ctype] = temp_file(m, "", fullfile); if (!compile_object(score, fullfile, ccan_dir, compiler, flags, i->compiled[ctype], &output)) { - talloc_free(i->compiled[ctype]); + tal_free(i->compiled[ctype]); score_file_error(score, i, 0, "Compiling object files:\n%s", output); @@ -58,14 +58,14 @@ void build_objects(struct manifest *m, if (!errors) { score->pass = true; score->score = score->total - warnings; - } + } else + build_failed = true; } static void check_objs_build(struct manifest *m, - bool keep, unsigned int *timeleft, struct score *score) { - build_objects(m, keep, score, cflags, COMPILE_NORMAL); + build_objects(m, score, cflags, COMPILE_NORMAL); } struct ccanlint objects_build = {