X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fbuild-coverage.c;h=7f75064219f495d514266559b5b25c9d79e94b91;hp=f1010204d0447221244c4b6466b3568a728f2187;hb=6c69b9ba6b46ea0d15f90eb1649cbb2acf6a28de;hpb=a200e1ad1cf5a4828ea4e4e222838ddad5a4a9a3 diff --git a/tools/ccanlint/tests/build-coverage.c b/tools/ccanlint/tests/build-coverage.c index f1010204..7f750642 100644 --- a/tools/ccanlint/tests/build-coverage.c +++ b/tools/ccanlint/tests/build-coverage.c @@ -13,7 +13,6 @@ #include #include #include -#include "build-coverage.h" /* Note: we already test safe_mode in run_tests.c */ static const char *can_run_coverage(struct manifest *m) @@ -87,23 +86,6 @@ static char *lib_list(const struct manifest *m) return ret; } -/* Grrr... gcov drops a turd in the current directory. */ -void move_gcov_turd(const char *dir, - struct ccan_file *file, const char *extension) -{ - char *base, *gcovfile, *gcovdest; - - base = talloc_basename(file, file->name); - gcovfile = talloc_asprintf(file, "%s/%.*s%s", - dir, strlen(base)-2, base, extension); - gcovdest = talloc_asprintf(file, "%s/%.*s%s", - talloc_dirname(base, file->cov_compiled), - strlen(base)-2, base, extension); - if (!move_file(gcovfile, gcovdest)) - err(1, "Could not move %s to %s", gcovfile, gcovdest); - talloc_free(base); -} - static char *cov_compile(const void *ctx, struct manifest *m, struct ccan_file *file, @@ -111,7 +93,6 @@ static char *cov_compile(const void *ctx, bool keep) { char *errmsg; - char path[PATH_MAX]; file->cov_compiled = maybe_temp_file(ctx, "", keep, file->fullname); errmsg = compile_and_link(ctx, file->fullname, ccan_dir, @@ -123,7 +104,6 @@ static char *cov_compile(const void *ctx, return errmsg; } - move_gcov_turd(getcwd(path, sizeof(path)), file, ".gcno"); return NULL; }