X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fdepends_build.c;h=b578d4b597b7f5b62d98dc5d6d5218b6be89a85b;hp=e7faa1f1503ed8632c02534ab3ca34d4aa86218a;hb=453fdc02ce54ff965f9971a3bfd0e1a79b6c98f9;hpb=441a3cb13e428cfa4973d83acb68e231a7cd4cf4 diff --git a/tools/ccanlint/tests/depends_build.c b/tools/ccanlint/tests/depends_build.c index e7faa1f1..b578d4b5 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 @@ -13,7 +14,7 @@ #include #include #include -#include "../compulsory_tests/build.h" +#include "build.h" static const char *can_build(struct manifest *m) { @@ -38,7 +39,7 @@ static char *build_subdir_objs(struct manifest *m, char *fullfile = talloc_asprintf(m, "%s/%s", m->dir, i->name); char *output; - i->compiled[ctype] = maybe_temp_file(m, "", false, fullfile); + i->compiled[ctype] = temp_file(m, "", fullfile); if (!compile_object(m, fullfile, ccan_dir, compiler, flags, i->compiled[ctype], &output)) { talloc_free(i->compiled[ctype]); @@ -70,27 +71,33 @@ char *build_submodule(struct manifest *m, const char *flags, if (errstr) return errstr; - m->compiled[ctype] = build_module(m, false, ctype, &errstr); + m->compiled[ctype] = build_module(m, ctype, &errstr); if (!m->compiled[ctype]) return errstr; return NULL; } static void check_depends_built(struct manifest *m, - bool keep, 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->basename, + errstr); + return; + } } } @@ -103,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);