Skip to content

Conversation

@julioest
Copy link
Contributor

Summary

  • Add customizable HTML templates for gcovr coverage reports with sidebar navigation
  • Add supporting scripts for local development on macOS
  • Update build process to work across both local/macOS and CI/Linux environments

Changes

Templates (templates/html/)
Custom Jinja2 templates that override gcovr's default HTML output:

  • Sidebar navigation with collapsible directory tree
  • Improved styling and layout
  • Source file viewer with line-by-line coverage highlighting

Scripts

  • build_tree.py - Generates tree.json for sidebar directory navigation
  • gcovr_wrapper.py - Wrapper for gcovr to handle Cobertura XML input

Build Script

  • Auto-detects paths from .info files for portability across machines
  • macOS workaround: converts lcov .info files to Cobertura XML since gcovr cannot read .gcda files directly on macOS
  • CI/Linux path uses gcovr directly with native coverage data

Test Plan

  • Run ./build.sh on macOS with a coverage_filtered.info file
  • Verify HTML report generates with working sidebar navigation
  • Run on CI/Linux and verify report generation

@julioest julioest marked this pull request as ready for review January 27, 2026 01:28
@julioest julioest requested a review from sdarwin January 27, 2026 01:28
@julioest julioest marked this pull request as draft January 27, 2026 01:29
@sdarwin
Copy link
Contributor

sdarwin commented Jan 27, 2026

What is the output of scripts/build_tree.py? One file or a series of files? What are the filenames, where does the output go. Could such info be mentioned in a comment at the top of build_tree.py, or elsewhere in a doc.

This repo is slightly temporary, although it's good for development purposes. Ultimately the templates will be located in https://github.com/cppalliance/ci-automation for deployment. You have marked the PR as a draft, but since the whole repo is like a develop branch, we can merge when you believe it's ready. At that time, remove 'draft' status. let me know.

@julioest julioest force-pushed the gcovr-ui-customization branch 3 times, most recently from b36c9f8 to 760950f Compare January 27, 2026 17:23
- Add HTML templates for customized gcovr coverage reports with sidebar navigation
- Add build_tree.py script to generate tree.json for directory navigation
- Add gcovr_wrapper.py for local coverage processing
- Update build.sh to handle both local/macOS and CI/Linux environments
- Add macOS workaround: auto-detect paths from .info files since gcovr cannot read .gcda files directly on macOS
- Add .gitignore for generated coverage reports and temp files
@julioest julioest force-pushed the gcovr-ui-customization branch from 760950f to de18ac8 Compare January 27, 2026 17:23
@julioest julioest marked this pull request as ready for review January 27, 2026 17:28
@julioest
Copy link
Contributor Author

What is the output of scripts/build_tree.py?

So, It creates a tree.json file. To build out the tree on the frontend.

Also, I pushed the files that this outputs, so you could see the UI. Open the json/gcovr/index.html file

@sdarwin
Copy link
Contributor

sdarwin commented Jan 27, 2026

The new pages look great. I will deploy it to production.

@sdarwin sdarwin closed this Jan 27, 2026
@sdarwin sdarwin reopened this Jan 27, 2026
@sdarwin sdarwin merged commit 891824f into cppalliance:master Jan 27, 2026
@sdarwin
Copy link
Contributor

sdarwin commented Jan 27, 2026

Results may be seen here:
boostorg/url#969
boostorg/json#1138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants