{"id":28206400,"url":"https://github.com/colcon/colcon-lcov-result","last_synced_at":"2025-06-11T21:31:10.704Z","repository":{"id":45304629,"uuid":"150468514","full_name":"colcon/colcon-lcov-result","owner":"colcon","description":"A colcon extension for collecting lcov output","archived":false,"fork":false,"pushed_at":"2024-11-25T22:43:43.000Z","size":63,"stargazers_count":7,"open_issues_count":6,"forks_count":7,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-17T10:09:46.212Z","etag":null,"topics":["colcon"],"latest_commit_sha":null,"homepage":"http://colcon.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/colcon.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-26T18:00:18.000Z","updated_at":"2024-11-25T22:43:51.000Z","dependencies_parsed_at":"2024-01-20T02:00:26.461Z","dependency_job_id":"d984a482-b474-4464-b90c-4db533c99e0e","html_url":"https://github.com/colcon/colcon-lcov-result","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/colcon/colcon-lcov-result","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colcon%2Fcolcon-lcov-result","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colcon%2Fcolcon-lcov-result/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colcon%2Fcolcon-lcov-result/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colcon%2Fcolcon-lcov-result/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/colcon","download_url":"https://codeload.github.com/colcon/colcon-lcov-result/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colcon%2Fcolcon-lcov-result/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259345533,"owners_count":22843555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["colcon"],"created_at":"2025-05-17T10:09:46.872Z","updated_at":"2025-06-11T21:31:10.698Z","avatar_url":"https://github.com/colcon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"colcon-lcov-result\n==================\n\nAn extension for `colcon-core \u003chttps://github.com/colcon/colcon-core\u003e`_ to provide aggregate\ncoverage results using `LCOV \u003chttp://ltp.sourceforge.net/coverage/lcov.php\u003e`_.\n\nLCOV is a graphical front-end for GCC's coverage testing tool\n`gcov \u003chttps://gcc.gnu.org/onlinedocs/gcc/Gcov.html\u003e`_, producing the following\ncoverage metrics:\n\n- Statement coverage\n- Function coverage\n- Branch coverage\n\nFor more information, see `this paper\n\u003chttp://ltp.sourceforge.net/documentation/technical_papers/gcov-ols2003.pdf\u003e`_\nand `this Wikipedia page \u003chttps://en.wikipedia.org/wiki/Code_coverage\u003e`_.\n\n\nUsage\n=====\n#. Build your packages with coverage flags, using ``colcon``:\n\n   .. code-block:: shell\n\n     $ colcon build \\\n           --symlink-install \\\n           --cmake-args \\\n               -DCMAKE_CXX_FLAGS='-fprofile-arcs -ftest-coverage' \\\n               -DCMAKE_C_FLAGS='-fprofile-arcs -ftest-coverage'\n\n   * See also `colcon-mixin \u003chttps://github.com/colcon/colcon-mixin\u003e`_ and \n     `colcon-mixin-repository \u003chttps://github.com/colcon/colcon-mixin-repository/blob/master/coverage.mixin\u003e`_\n     for a short-hand command (``--mixin coverage-gcc``)\n  \n#. Create a baseline for zero coverage:\n\n   .. code-block:: shell\n\n     $ colcon lcov-result --initial\n  \n   * This step is optional, but will help reveal any files that are untouched by\n     tests\n\n#. Run tests:\n\n   .. code-block:: shell\n\n     $ colcon test\n\n#. Gather the ``lcov`` results:\n\n   .. code-block:: shell\n\n     $ colcon lcov-result\n     Reading tracefile /home/user/workspace/my_cool_ws/lcov/total_coverage.info\n     Summary coverage rate:\n       lines......: 78.6% (44 of 56 lines)\n       functions..: 94.4% (34 of 36 functions)\n       branches...: 37.0% (34 of 92 branches)\n\n#. Browse the coverage report by opening ``lcov/index.html`` in a browser\n\n#. Zero the coverage counters and re-run tests:\n\n   .. code-block:: shell\n\n     $ colcon lcov-result --zero-counters\n     $ colcon lcov-result --initial\n     $ colcon test\n     $ colcon lcov-result\n     Reading tracefile /home/user/workspace/my_cool_ws/lcov/total_coverage.info\n     Summary coverage rate:\n       lines......: 78.6% (44 of 56 lines)\n       functions..: 94.4% (34 of 36 functions)\n       branches...: 37.0% (34 of 92 branches)\n\n\nTips and Tricks\n===============\n\n* When running locally, use the ``--packages-select`` option to generate\n  coverage information for relevant packages\n  \n  * This will also suppress warnings for packages that were either not built\n    with coverage flags or for which tests did not run\n\n* The ``--verbose`` flag can be used to print the coverage summary of each\n  individual package as the results are analyzed\n\n\nContributing\n============\n\nFor non-trivial contributions, it is recommended to first create an issue to discuss\nyour ideas.\n\nThe following is the recommended workflow for contributing:\n\n#. Install ``colcon`` and extensions in a virtual environment:\n\n   .. code-block:: shell\n\n     $ cd \u003cworkspace\u003e\n     $ python3 -m venv colcon-env\n     $ source colcon-env/bin/activate\n     $ pip3 install colcon-common-extensions\n\n#. Install ``colcon-lcov-result`` in editable mode:\n\n   .. code-block:: shell\n\n     $ cd \u003cworkspace\u003e\n     $ python3 -m venv colcon-env\n     $ source colcon-env/bin/activate\n     $ cd path/to/colcon-lcov-result\n     $ pip3 install -e .\n\n#. As long as you are in the virtual environment, make changes to ``colcon-lcov-result``\n   run ``colcon lcov-result``, and see the effect of the changes\n\n#. Commit changes and submit a PR:\n\n   * See `The seven rules of a great Git commit message`_\n\n.. _The seven rules of a great Git commit message: https://chris.beams.io/posts/git-commit/#seven-rules\n\n\nTroubleshooting\n===============\n\n* The following warning when running ``colcon lcov-result --initial`` implies\n  that the package was not built with the correct flags:\n\n  .. code-block:: shell\n  \n     --- stderr: my_pkg                                                        \n     geninfo: WARNING: no .gcno files found in /home/user/workspace/build/my_pkg - skipping!\n     ---\n\n  * The package will not show up in the final results. Use ``--packages-skip`` to suppress\n    the warning\n\n* The following warning when running ``colcon lcov-result`` implies that no tests\n  ran for that package\n  \n  .. code-block:: shell\n\n     [0.576s] ERROR:colcon.colcon_lcov_result.task.lcov:lcov:\n     ERROR: no valid records found in tracefile /home/user/workspace/build/my_pkg/coverage.info\n     --- stderr: my_pkg\n     geninfo: WARNING: no .gcda files found in /home/user/workspace/build/my_pkg - skipping!\n     ---\n\n  * The package will show up in the final results with 0% coverage. Use ``--packages-skip``\n    to suppress these packages from the total\n\n\nKnown Issues\n============\n\n#. The final step of aggregating all the result files can be slow depending\n   on the number of packages that were analyzed\n\nDeveloping\n==========\n\nSee `DEVELOPING.md \u003cDEVELOPING.md\u003e`_.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolcon%2Fcolcon-lcov-result","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolcon%2Fcolcon-lcov-result","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolcon%2Fcolcon-lcov-result/lists"}