X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fdepends_build_without_features.c;h=cacb5002532c8f8f0e8b39c4d7bb39956f722c57;hp=cf7185be0d80fc2f79aa5cf776663e0b7639eca9;hb=HEAD;hpb=939fab341caaa06d032b29f06362335de0db82cc diff --git a/tools/ccanlint/tests/depends_build_without_features.c b/tools/ccanlint/tests/depends_build_without_features.c index cf7185be..cacb5002 100644 --- a/tools/ccanlint/tests/depends_build_without_features.c +++ b/tools/ccanlint/tests/depends_build_without_features.c @@ -1,7 +1,7 @@ #include #include -#include #include +#include #include #include #include @@ -14,9 +14,9 @@ #include #include #include "reduce_features.h" -#include "../compulsory_tests/build.h" +#include "build.h" -static const char *can_build(struct manifest *m) +static const char *can_build(struct manifest *m UNNEEDED) { if (safe_mode) return "Safe mode enabled"; @@ -24,25 +24,28 @@ static const char *can_build(struct manifest *m) } static void check_depends_built_without_features(struct manifest *m, - bool keep, - unsigned int *timeleft, + unsigned int *timeleft UNNEEDED, struct score *score) { + struct list_head *list; struct manifest *i; char *flags; - flags = talloc_asprintf(score, "%s %s", cflags, - REDUCE_FEATURES_FLAGS); + flags = tal_fmt(score, "%s %s", cflags, REDUCE_FEATURES_FLAGS); - list_for_each(&m->deps, i, list) { - char *errstr = build_submodule(i, flags, COMPILE_NOFEAT); + foreach_ptr(list, &m->deps, &m->test_deps) { + list_for_each(list, i, list) { + char *errstr = build_submodule(i, flags, + COMPILE_NOFEAT); - if (errstr) { - score->error = talloc_asprintf(score, + if (errstr) { + score->error = tal_fmt(score, "Dependency %s" " did not build:\n%s", - i->basename, errstr); - return; + i->modname, + errstr); + return; + } } } @@ -55,7 +58,7 @@ struct ccanlint depends_build_without_features = { .name = "Module's CCAN dependencies can be found or built (reduced features)", .check = check_depends_built_without_features, .can_run = can_build, - .needs = "depends_exist" + .needs = "depends_build reduce_features" }; REGISTER_TEST(depends_build_without_features);