char *fullfile = talloc_asprintf(m, "%s/%s", m->dir, i->name);
i->cov_compiled = maybe_temp_file(m, "", keep, fullfile);
- if (!compile_object(m, fullfile, ccan_dir, "",
+ if (!compile_object(m, fullfile, ccan_dir, compiler, cflags,
i->cov_compiled, &err)) {
- score_file_error(score, i, 0, err);
+ score_file_error(score, i, 0, "%s", err);
talloc_free(i->cov_compiled);
i->cov_compiled = NULL;
return false;
bool keep)
{
char *output;
+ char *f = talloc_asprintf(ctx, "%s %s", cflags, COVERAGE_CFLAGS);
file->cov_compiled = maybe_temp_file(ctx, "", keep, file->fullname);
if (!compile_and_link(ctx, file->fullname, ccan_dir,
obj_list(m, modobjs),
- COVERAGE_CFLAGS,
+ compiler, f,
lib_list(m), file->cov_compiled, &output)) {
talloc_free(file->cov_compiled);
file->cov_compiled = NULL;
foreach_ptr(h, &m->run_tests, &m->api_tests) {
list_for_each(h, i, list) {
- cmdout = cov_compile(m, m, i, NULL, keep);
+ cmdout = cov_compile(m, m, i,
+ h == &m->api_tests
+ ? modobjs : NULL,
+ keep);
if (cmdout) {
score_file_error(score, i, 0,
"Failed to compile test with coverage: %s",