]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/objects_build.c
ccanlint: add "_info ported" (for ccan/altstack).
[ccan] / tools / ccanlint / tests / objects_build.c
index 21a02773aeb95dc18cbb11e7acbedeacba271372..d0bd7365dc7c52024975626c0e950a2a6e1d8e87 100644 (file)
@@ -22,6 +22,17 @@ static const char *can_build(struct manifest *m)
        return NULL;
 }
 
+static char *cflags_list(const struct manifest *m)
+{
+       unsigned int i;
+       char *ret = tal_strdup(m, cflags);
+
+       char **flags = get_cflags(m, m->dir, get_or_compile_info);
+       for (i = 0; flags[i]; i++)
+               tal_append_fmt(&ret, " %s", flags[i]);
+       return ret;
+}
+
 void build_objects(struct manifest *m,
                   struct score *score, const char *flags,
                   enum compile_type ctype)
@@ -58,13 +69,17 @@ void build_objects(struct manifest *m,
        if (!errors) {
                score->pass = true;
                score->score = score->total - warnings;
-       }
+       } else
+               build_failed = true;
 }
 
 static void check_objs_build(struct manifest *m,
                             unsigned int *timeleft, struct score *score)
 {
-       build_objects(m, score, cflags, COMPILE_NORMAL);
+       const char *flags;
+
+       flags = cflags_list(m);
+       build_objects(m, score, flags, COMPILE_NORMAL);
 }
 
 struct ccanlint objects_build = {
@@ -73,7 +88,7 @@ struct ccanlint objects_build = {
        .compulsory = true,
        .check = check_objs_build,
        .can_run = can_build,
-       .needs = "depends_exist"
+       .needs = "depends_exist info_ported"
 };
 
 REGISTER_TEST(objects_build);