X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fobjects_build_with_stringchecks.c;h=c2fe1b6cc7c519e52d920ae5df14c510e8f42072;hb=932d65dd6537250e617516749f03a00fea3b34f6;hp=32fa22ea54bff1e084006c75bbbdc5fd1597089d;hpb=2621f3adc8786e6655c69edc29d6a3560d41cd32;p=ccan diff --git a/tools/ccanlint/tests/objects_build_with_stringchecks.c b/tools/ccanlint/tests/objects_build_with_stringchecks.c index 32fa22ea..c2fe1b6c 100644 --- a/tools/ccanlint/tests/objects_build_with_stringchecks.c +++ b/tools/ccanlint/tests/objects_build_with_stringchecks.c @@ -58,14 +58,13 @@ static int start_file(const char *filename) static void test_compile(struct score *score, struct ccan_file *file, const char *filename, - bool keep, const char *flags, bool *errors, bool *warnings) { char *output, *compiled; - compiled = maybe_temp_file(score, "", keep, filename); + compiled = temp_file(score, "", filename); if (!compile_object(score, filename, ccan_dir, compiler, flags, compiled, &output)) { score_file_error(score, file, 0, @@ -95,7 +94,7 @@ static struct ccan_file *get_main_header(struct manifest *m) } static void build_objects_with_stringchecks(struct manifest *m, - bool keep, unsigned int *timeleft, + unsigned int *timeleft, struct score *score) { struct ccan_file *i; @@ -110,27 +109,28 @@ static void build_objects_with_stringchecks(struct manifest *m, if (list_empty(&m->c_files)) { char *line; i = get_main_header(m); - tmp = maybe_temp_file(score, ".c", keep, i->fullname); + tmp = temp_file(score, ".c", i->fullname); tmpfd = start_file(tmp); line = talloc_asprintf(score, "#include \n", - m->basename, m->basename); + m->modname, m->basename); write_str(tmpfd, line); close(tmpfd); - test_compile(score, i, tmp, keep, flags, &errors, &warnings); + test_compile(score, i, tmp, flags, &errors, &warnings); } else { list_for_each(&m->c_files, i, list) { - tmp = maybe_temp_file(score, ".c", keep, i->fullname); + tmp = temp_file(score, ".c", i->fullname); tmpfd = start_file(tmp); write_str(tmpfd, get_ccan_file_contents(i)); close(tmpfd); - test_compile(score, i, tmp, keep, flags, - &errors, &warnings); + test_compile(score, i, tmp, flags, &errors, &warnings); } } + /* We don't fail ccanlint for this. */ + score->pass = true; + score->total = 1; if (!errors) { - score->pass = true; score->score = !warnings; } }