X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fbuild-coverage.c;h=927cd8b077dbaf813af63e5f7f696421096e0652;hp=9415647f8f46974705af95fc2c96eca7a0af964b;hb=f9423c171395571f9880286190d9cf63da147668;hpb=03a596908b779bbb4b7c2f739c5e238f8c5d6390 diff --git a/tools/ccanlint/tests/build-coverage.c b/tools/ccanlint/tests/build-coverage.c index 9415647f..927cd8b0 100644 --- a/tools/ccanlint/tests/build-coverage.c +++ b/tools/ccanlint/tests/build-coverage.c @@ -50,16 +50,12 @@ static bool build_module_objs_with_coverage(struct manifest *m, bool keep, return true; } +/* FIXME: Merge this into one place. */ static char *obj_list(const struct manifest *m, const char *modobjs) { - char *list; + char *list = talloc_strdup(m, ""); struct ccan_file *i; - - /* We expect to be linked with tap, unless that's us. */ - if (!streq(m->basename, "tap")) - list = talloc_asprintf(m, "%s/ccan/tap.o", ccan_dir); - else - list = talloc_strdup(m, ""); + struct manifest *subm; /* Objects from any other C files. */ list_for_each(&m->other_test_c_files, i, list) @@ -69,9 +65,10 @@ static char *obj_list(const struct manifest *m, const char *modobjs) list = talloc_append_string(list, modobjs); /* Other ccan modules (don't need coverage versions of those). */ - list_for_each(&m->dep_dirs, i, list) { - if (i->compiled) - list = talloc_asprintf_append(list, " %s", i->compiled); + list_for_each(&m->deps, subm, list) { + if (subm->compiled) + list = talloc_asprintf_append(list, " %s", + subm->compiled); } return list; @@ -146,8 +143,8 @@ static void do_compile_coverage_tests(struct manifest *m, } struct ccanlint compile_coverage_tests = { - .key = "compile-coverage-tests", - .name = "Module tests compile with profiling", + .key = "tests_compile_coverage", + .name = "Module tests compile with " COVERAGE_CFLAGS, .check = do_compile_coverage_tests, .can_run = can_run_coverage, };