]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/compile_test_helpers.c
ccanlint: only compile _info once; speeds tdb test from 18 to 16 seconds.
[ccan] / tools / ccanlint / tests / compile_test_helpers.c
index 017a5308cbc4b48f6cba5b5f7bb6cae615efbdcc..2aa8d8639800a379bad6d42f70652b09b5393cda 100644 (file)
@@ -21,12 +21,6 @@ static const char *can_build(struct manifest *m)
        return NULL;
 }
 
-static int cleanup_testfile(char *testfile)
-{
-       unlink(testfile);
-       return 0;
-}
-
 static char *objname(const void *ctx, const char *cfile)
 {
        return talloc_asprintf(ctx, "%.*s.o ", strlen(cfile) - 2, cfile);
@@ -37,8 +31,7 @@ static char *compile(struct manifest *m, const char *cfile)
        char *obj;
 
        obj = objname(m, cfile);
-       talloc_set_destructor(obj, cleanup_testfile);
-       return run_command(m, "cc " CFLAGS " -c -o %s %s", obj, cfile);
+       return compile_object(m, obj, cfile);
 }
 
 static void *do_compile_test_helpers(struct manifest *m)