[infra] Export coverage data in JSON format for picking up by CF. (#1665)

This commit is contained in:
Max Moroz 2018-07-27 07:34:02 -07:00 committed by GitHub
parent 0980a8d92a
commit 6b761f3826
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -28,6 +28,9 @@ rm -rf $LOGS_DIR && mkdir -p $LOGS_DIR
REPORT_DIR="$OUT/report"
rm -rf $REPORT_DIR
PROFILE_FILE="merged.data"
SUMMARY_FILE="$REPORT_DIR/summary.json"
# This will be used by llvm-cov command to generate the actual report.
objects=""
@ -70,7 +73,7 @@ done
wait
# Merge all raw dumps.
llvm-profdata merge -sparse *.profraw -o merged.profdata
llvm-profdata merge -sparse *.profraw -o $PROFILE_FILE
# Delete unnecessary and (potentially) large .profraw files.
rm *.profraw
@ -79,7 +82,12 @@ rm *.profraw
# Generate HTML report.
llvm-cov show -format=html -output-dir=$REPORT_DIR -path-equivalence="/,$OUT" \
$COVERAGE_EXTRA_ARGS -instr-profile merged.profdata $objects
-Xdemangler c++filt -Xdemangler -n $COVERAGE_EXTRA_ARGS \
-instr-profile=$PROFILE_FILE $objects
# Export coverage summary in JSON format.
llvm-cov export -summary-only -instr-profile=$PROFILE_FILE $objects \
> $SUMMARY_FILE
if [[ -n $HTTP_PORT ]]; then
# Serve the report locally.