- file->compiled[COMPILE_COVERAGE]
- = maybe_temp_file(ctx, "", keep, file->fullname);
- if (!compile_and_link(ctx, file->fullname, ccan_dir,
- test_obj_list(m, link_with_module,
- COMPILE_NORMAL,
- COMPILE_COVERAGE),
- compiler, flags,
- lib_list(m, COMPILE_NORMAL),
- file->compiled[COMPILE_COVERAGE], &output)) {
- talloc_free(file->compiled[COMPILE_COVERAGE]);
- file->compiled[COMPILE_COVERAGE] = NULL;
- return output;
- }
- talloc_free(output);
- return NULL;
+ char **flags = get_cflags(m, m->dir, get_or_compile_info);
+ for (i = 0; flags[i]; i++)
+ tal_append_fmt(&iflags, " %s", flags[i]);
+ return iflags;
+}
+
+static void cov_compile(const void *ctx,
+ unsigned int time_ms,
+ struct manifest *m,
+ struct ccan_file *file,
+ bool link_with_module)
+{
+ char *flags = tal_fmt(ctx, "%s %s", cflags, COVERAGE_CFLAGS);
+ flags = cflags_list_append(m, flags);
+
+ file->compiled[COMPILE_COVERAGE] = temp_file(ctx, "", file->fullname);
+ compile_and_link_async(file, time_ms, file->fullname, ccan_dir,
+ test_obj_list(m, link_with_module,
+ COMPILE_NORMAL,
+ COMPILE_COVERAGE),
+ compiler, flags,
+ test_lib_list(m, COMPILE_NORMAL),
+ file->compiled[COMPILE_COVERAGE]);