X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fcompile_test_helpers.c;h=2aa8d8639800a379bad6d42f70652b09b5393cda;hp=017a5308cbc4b48f6cba5b5f7bb6cae615efbdcc;hb=3612661714e86333ceacca7314959a5ed938dc6a;hpb=165727526f785b05f67f3d88f9518a0a840acbbf diff --git a/tools/ccanlint/tests/compile_test_helpers.c b/tools/ccanlint/tests/compile_test_helpers.c index 017a5308..2aa8d863 100644 --- a/tools/ccanlint/tests/compile_test_helpers.c +++ b/tools/ccanlint/tests/compile_test_helpers.c @@ -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)