]> git.ozlabs.org Git - ccan-lca-2011.git/blobdiff - tools/ccanlint/tests/compile_tests.c
ccanlint: make compile commands return output.
[ccan-lca-2011.git] / tools / ccanlint / tests / compile_tests.c
index 062912d427ea3bb49e2b22a71cca94082c606df3..3549cdedf6611c0ce33bf4866b767a25de018e11 100644 (file)
@@ -53,7 +53,7 @@ static char *obj_list(const struct manifest *m, bool link_with_module)
 static char *lib_list(const struct manifest *m)
 {
        unsigned int i, num;
-       char **libs = get_libs(m, ".", &num, &m->info_file->compiled);
+       char **libs = get_libs(m, m->dir, &num, &m->info_file->compiled);
        char *ret = talloc_strdup(m, "");
 
        for (i = 0; i < num; i++)
@@ -71,14 +71,14 @@ static char *compile(const void *ctx,
        char *errmsg;
 
        file->compiled = maybe_temp_file(ctx, "", keep, file->fullname);
-       errmsg = compile_and_link(ctx, file->fullname, ccan_dir,
-                                 obj_list(m, link_with_module),
-                                 fail ? "-DFAIL" : "",
-                                 lib_list(m), file->compiled);
-       if (errmsg) {
+       if (!compile_and_link(ctx, file->fullname, ccan_dir,
+                             obj_list(m, link_with_module),
+                             fail ? "-DFAIL" : "",
+                             lib_list(m), file->compiled, &errmsg)) {
                talloc_free(file->compiled);
                return errmsg;
        }
+       talloc_free(errmsg);
        return NULL;
 }