infra: fix per-target coverage html generation (#7927)

* infra: fix per-target coverage html generation

When generating coverage reports for single targets we should not
include all fuzz targets (in the $objects var), but only the object
(binary file) for the given target.

Ref: https://github.com/ossf/fuzz-introspector/issues/340

* coverage: remove potential race condition
This commit is contained in:
DavidKorczynski 2022-06-30 06:06:42 -02:00 committed by GitHub
parent a2eaeebecb
commit cf816c3244
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -107,8 +107,7 @@ function run_fuzz_target {
fi
# If necessary translate to latest profraw version.
profraw_update.py $OUT/$target $profraw_file_mask tmp.profraw
mv tmp.profraw $profraw_file_mask
profraw_update.py $OUT/$target $profraw_file_mask $profraw_file_mask
llvm-profdata merge -j=1 -sparse $profraw_file_mask -o $profdata_file
# Delete unnecessary and (potentially) large .profraw files.
@ -387,7 +386,7 @@ else
fi
report_dir=$REPORT_BY_TARGET_ROOT_DIR/$fuzz_target
generate_html $profdata_path "$shared_libraries" "$objects" "$report_dir"
generate_html $profdata_path "$shared_libraries" "$fuzz_target" "$report_dir"
done
fi