-
Notifications
You must be signed in to change notification settings - Fork 1
HTML Template Fixes & Local Development Environment #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- Updated .gitignore to include additional coverage report directories and build/test artifacts. - Deleted obsolete configuration and build files from the boost-root directory, including logs, cache files, and object files.
- Add Docker build environment (Ubuntu 24.04, gcc-13, lcov v2.3, gcovr 8.4) - Add setup-local-venv.sh for local Python venv setup - Add DEVELOPMENT.md documenting the local workflow - Update .gitignore to exclude generated coverage files and build artifacts
- Use --json-add-tracefile for coverage.json (preserves function/branch data) - Add --merge-lines flag for line merging - Keep LCOV/Cobertura conversion as fallback with warning - Fix gcovr_wrapper.py shebang to use portable #!/usr/bin/env python3
These files are now gitignored and will be regenerated locally: - json/*.info (LCOV coverage data) - json/gcovr/* (HTML report output)
Automatically sources .venv/bin/activate if present, so users can run ./build.sh directly without manual venv activation.
From PR cppalliance#2 - fixes display of paths with '../' prefixes: - Add clean_path(), clean_display_name(), is_file_path() helpers - Create intermediate directories when gcovr doesn't provide them - Add fullPath field for proper tooltips - Auto-detect and skip breadcrumb prefixes not in tree - Apply coverage class coloring to tree labels - Fix re-injection by removing existing data first Also removes regenerated coverage output from tracking.
- Extract just filename/folder name for display instead of full paths - Add title attribute to show full path on hover - Improve file vs directory icon detection using extracted name
- Rename --mini to --quick/-q for clarity - Create coverage_sample.json with 40 files (mix of small/medium/larger) - Add coverage_sample.json to .gitignore
|
It's sort of funny. The very existence of the repo was based on a request from Vinnie,
That said, if this is the direction the repository must go in, it should be fine. |
|
🤭 That is pretty funny. I forgot the main reason why I couldn't run it on my machine, since I was moving so fast. But now that I know more about this project, I can go back and look to see what I can remove (like Docker) to fulfill Vinnie's requirements. |
|
If this makes the workflow the easiest and the most correct for you, it should stay. |
then arguably the whole boost-root folder should also be deleted. Instead, in the scripts, clone the boost superproject, and then check out all submodules, at which point a boost-root has been created. git-ignore the whole boost-root.
which has a certain logic, since they should be re-generated every time, however since https://github.com/cppalliance/gcovr-development is an unusual repository, it's purely for development, with ci-automate being the production side, wouldn't it be convenient to check-in the gcovr-output, show it in the repo, so others can see what the latest output is expected to look like? Continuing this line of reasoning, if boost-root will be removed from the repo, instead of dumping output to
|
- Remove boost-root/ and json/ from version control (9320 files) - Add setup-boost.sh to clone Boost on demand - Move gcovr output to top-level gcovr-output/ - Update build.sh for new structure - Update DEVELOPMENT.md with new workflow Boost source should be cloned via scripts, not checked into the repo.
- coverage_sample.json (1.6 MB) allows template testing without generating full coverage data - .gitignore updated to exclude full coverage.json (too large for GitHub)
|
All righty Sam, Here’s what I changed: Repo cleanup Output location Coverage data Fresh clone test git clone ... && git checkout html-template-fixes
./setup-local-venv.sh
./setup-boost.sh json
./build.sh --quickThat produced 60 HTML files as expected. |
Summary
This PR adds a local development environment for customizing gcovr HTML report templates, along with several UI fixes and improvements.
Changes
Local development setup
DEVELOPMENT.mdwith setup instructionsDockerfilefor generating coverage datasetup-local-venv.shfor local Python environmentsetup-boost.shto clone Boost on demand (e.g../setup-boost.sh jsonfor the JSON library only)coverage_sample.json(1.6 MB) so quick builds work without Docker--quickflag tobuild.shfor faster template iteration using sample databoost-root/,json/, fullcoverage.json)Output
templates/html/gcovr-output/to top-levelgcovr-output/build.shto gcovr JSON tracefile format and simplify sample selection for quick buildsTemplate fixes
Testing
From a fresh clone:
View gcovr-output/index.html (generates ~60 HTML files)