X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;ds=sidebyside;f=tools%2Fccanlint%2Ftests%2Fdepends_build.c;h=3cfb9c4460161475e932de455f2e5bde96c0dff7;hb=10e5e329a1a8804ff6461e1724071364cf6be572;hp=e6300a19502559fc3a69effa3e6b6218cae75c2b;hpb=af5b1a18948345c5f9f9abf4eda3ab9fe0aa9a9f;p=ccan diff --git a/tools/ccanlint/tests/depends_build.c b/tools/ccanlint/tests/depends_build.c index e6300a19..3cfb9c44 100644 --- a/tools/ccanlint/tests/depends_build.c +++ b/tools/ccanlint/tests/depends_build.c @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -46,7 +47,7 @@ static char *build_subdir_objs(struct manifest *m, return talloc_asprintf(m, "Dependency %s" " did not build:\n%s", - m->basename, output); + m->modname, output); } } return NULL; @@ -79,17 +80,24 @@ char *build_submodule(struct manifest *m, const char *flags, static void check_depends_built(struct manifest *m, unsigned int *timeleft, struct score *score) { - struct manifest *i; - - list_for_each(&m->deps, i, list) { - char *errstr = build_submodule(i, cflags, COMPILE_NORMAL); - - if (errstr) { - score->error = talloc_asprintf(score, - "Dependency %s" - " did not build:\n%s", - i->basename, errstr); - return; + struct list_head *list; + + foreach_ptr(list, &m->deps, &m->test_deps) { + struct manifest *i; + list_for_each(list, i, list) { + char *errstr; + + errstr = build_submodule(i, cflags, COMPILE_NORMAL); + + if (errstr) { + score->error = talloc_asprintf(score, + "Dependency %s" + " did not" + " build:\n%s", + i->modname, + errstr); + return; + } } } @@ -102,7 +110,7 @@ struct ccanlint depends_build = { .name = "Module's CCAN dependencies can be found or built", .check = check_depends_built, .can_run = can_build, - .needs = "depends_exist" + .needs = "depends_exist test_depends_exist" }; REGISTER_TEST(depends_build);