Coverage: $filename
Back to Summary
Coverage: $filename
Branches Taken: $taken / $branches ($percentage%)
FILEHEADER
# Process the gcov file and add source code with branch info
awk '
/^branch/ {
branch_info = branch_info " " $0
next
}
/^ / {
# Line with execution count
line_num = $2
gsub(/:/, "", line_num)
exec_count = $1
gsub(/^[ \t]+/, "", exec_count)
# Get the actual source line
line_content = substr($0, index($0, $3))
# Format execution count
if (exec_count == "-") {
exec_str = "-"
} else if (exec_count == "#####") {
exec_str = "0"
} else {
exec_str = exec_count
}
# Output line number, execution count, and source
printf "%6s: %5s:%s", line_num, exec_str, line_content
if (branch_info != "") {
printf " [%s]", branch_info
}
printf "\n"
branch_info = ""
}
' "$gcov_file" >> "$OUTPUT_DIR/$file_html"
cat >> "$OUTPUT_DIR/$file_html" <<'FILEFOOTER'
FILEFOOTER
# Add row to main index
cat >> "$OUTPUT_DIR/index.html" <
$filename |
$taken |
$branches |
${percentage}% |
TABLEROW
fi
fi
done
# Close HTML
cat >> "$OUTPUT_DIR/index.html" <<'HTMLFOOTER'