X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fcompile_tests.c;h=4d8686798c0aa12040defb489cd28ebc4d7acd1b;hb=2926cafb52b9d95646d9dafa877d53f2368d8b2c;hp=e95849b2b7eaf89b4636e1670baa6fe4517822be;hpb=85c347709c1740af23dde53685475e5d8118125e;p=ccan-lca-2011.git diff --git a/tools/ccanlint/tests/compile_tests.c b/tools/ccanlint/tests/compile_tests.c index e95849b..4d86867 100644 --- a/tools/ccanlint/tests/compile_tests.c +++ b/tools/ccanlint/tests/compile_tests.c @@ -22,16 +22,12 @@ static const char *can_build(struct manifest *m) return NULL; } +/* FIXME: Merge this into one place. */ static char *obj_list(const struct manifest *m, bool link_with_module) { - 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) @@ -43,9 +39,10 @@ static char *obj_list(const struct manifest *m, bool link_with_module) list = talloc_asprintf_append(list, " %s", i->compiled); /* Other ccan modules. */ - 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; @@ -133,11 +130,12 @@ static void do_compile_tests(struct manifest *m, score->score = 1 + !warnings; } -struct ccanlint compile_tests = { - .key = "compile-tests", +struct ccanlint tests_compile = { + .key = "tests_compile", .name = "Module tests compile", .check = do_compile_tests, .can_run = can_build, + .needs = "tests_helpers_compile objects_build" }; -REGISTER_TEST(compile_tests, &compile_test_helpers, &build_objs, NULL); +REGISTER_TEST(tests_compile);