X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fbuild_objs.c;h=e0ea222350bc981ed3075270a0db3ee7459cf1f1;hp=199772ab8f1d08614d57eec52b2fea811a9e44fb;hb=3612661714e86333ceacca7314959a5ed938dc6a;hpb=61088f5c752c555172e2ab6cf93a7967f79f3f2c diff --git a/tools/ccanlint/tests/build_objs.c b/tools/ccanlint/tests/build_objs.c index 199772ab..e0ea2223 100644 --- a/tools/ccanlint/tests/build_objs.c +++ b/tools/ccanlint/tests/build_objs.c @@ -16,8 +16,6 @@ static const char *can_build(struct manifest *m) { - if (list_empty(&m->c_files)) - return "No C files in module"; if (safe_mode) return "Safe mode enabled"; return NULL; @@ -25,15 +23,14 @@ static const char *can_build(struct manifest *m) static bool compile_obj(struct ccan_file *c_file, char *objfile, char **report) { - char *contents; + char *err; - contents = run_command(objfile, "cc " CFLAGS " -o %s -c %s", - objfile, c_file->name); - if (contents) { + err = compile_object(objfile, objfile, c_file->name); + if (err) { if (*report) - *report = talloc_append_string(*report, contents); + *report = talloc_append_string(*report, err); else - *report = contents; + *report = err; return false; } return true; @@ -51,7 +48,6 @@ static void *check_objs_build(struct manifest *m) struct ccan_file *i; /* One point for each obj file. */ - build_objs.total_score = 0; list_for_each(&m->c_files, i, list) build_objs.total_score++; @@ -73,7 +69,6 @@ static const char *describe_objs_build(struct manifest *m, void *check_result) struct ccanlint build_objs = { .name = "Module object files can be built", - .total_score = 1, .check = check_objs_build, .describe = describe_objs_build, .can_run = can_build,