]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/depends_build_without_features.c
tools: use tal instead of talloc.
[ccan] / tools / ccanlint / tests / depends_build_without_features.c
index 533f4f318ce869cfb48f83882aa713bea5457dfa..f9f582aff79aada824d8d05465634b20506fd136 100644 (file)
@@ -1,7 +1,7 @@
 #include <tools/ccanlint/ccanlint.h>
 #include <tools/tools.h>
-#include <ccan/talloc/talloc.h>
 #include <ccan/str/str.h>
+#include <ccan/foreach/foreach.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -27,21 +27,25 @@ static void check_depends_built_without_features(struct manifest *m,
                                                 unsigned int *timeleft,
                                                 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;
+                       }
                }
        }