Skip to content

Commit

Permalink
Merge pull request #13 from bw-hro/dev
Browse files Browse the repository at this point in the history
add link back to main page in coverage report html
  • Loading branch information
bw-hro authored Nov 28, 2024
2 parents c63bb17 + d4744f3 commit 2d22690
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,23 @@ total_line_coverage=$(grep -E "lines" "${build_dir}/coverage_summary.txt" | awk
echo "{\"total_line_coverage\": \"$total_line_coverage\"}" > "${build_dir}/coverage_summary.json"

echo "generate coverage report:"

html_prolog="${build_dir}/coverage_report_prolog.html"
rm -f $html_prolog

echo '<html lang="en">' >> $html_prolog
echo '<head>' >> $html_prolog
echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">' >> $html_prolog
echo '<title>TempDir - @pagetitle@</title>' >> $html_prolog
echo '<link rel="stylesheet" type="text/css" href="@[email protected]">' >> $html_prolog
echo '</head>' >> $html_prolog
echo '<body>' >> $html_prolog
echo '<h1 style="font-family:sans-serif;text-align:center;">' >> $html_prolog
echo '<a href="../@basedir@">TempDir</a>: Simplified Temporary Directory for C++' >> $html_prolog
echo '</h1><hr/>' >> $html_prolog

rm -Rf "${build_dir}/coverage_report"
genhtml "${build_dir}/filtered_coverage.info" --output-directory "${build_dir}/coverage_report"
genhtml "${build_dir}/filtered_coverage.info" -o "${build_dir}/coverage_report" --html-prolog "${build_dir}/coverage_report_prolog.html"

echo "download coverage badge"
curl -o "${build_dir}/coverage_report/badge.svg" "https://img.shields.io/badge/coverage-${total_line_coverage}25-rgb%2850,201,85%29"

0 comments on commit 2d22690

Please sign in to comment.