{"id":19696044,"url":"https://github.com/delsner/cpp-test-specific-coverage","last_synced_at":"2026-06-17T14:32:44.449Z","repository":{"id":128465530,"uuid":"242948935","full_name":"delsner/cpp-test-specific-coverage","owner":"delsner","description":"Obtaining test specific coverage from a Google Test C++ application with OpenCppCoverage","archived":false,"fork":false,"pushed_at":"2022-02-28T20:20:38.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-27T14:22:56.746Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/delsner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-02-25T08:31:52.000Z","updated_at":"2021-11-29T13:11:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"4e4c94a0-7f1d-46fa-b0c4-de9d72eac3e7","html_url":"https://github.com/delsner/cpp-test-specific-coverage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/delsner/cpp-test-specific-coverage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delsner%2Fcpp-test-specific-coverage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delsner%2Fcpp-test-specific-coverage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delsner%2Fcpp-test-specific-coverage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delsner%2Fcpp-test-specific-coverage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/delsner","download_url":"https://codeload.github.com/delsner/cpp-test-specific-coverage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delsner%2Fcpp-test-specific-coverage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34453431,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-11T19:33:15.091Z","updated_at":"2026-06-17T14:32:44.427Z","avatar_url":"https://github.com/delsner.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Test-specific Code Coverage in C++ with OpenCppCoverage\n\nThis repository demonstrates the use of OpenCppCoverage to gather coverage per test case in C++ projects using Google's Testing framework.\n\n## Google Test\n\n[Google Test](https://github.com/google/googletest) is Google's C++ test framework used to create test cases.\nThe [hooks inside Google Test](https://google.github.io/googletest/advanced.html#defining-event-listeners) can be used for implementing the necessary control flow to realize coverage per test case.\n\n## OpenCppCoverage\n\n[`OpenCppCoverage`](https://github.com/OpenCppCoverage/OpenCppCoverage) is an open-source tool for obtaining coverage from `.pdb` files as created by MS Visual C++.\n\nIt is modified for test-specific coverage in [this fork](https://github.com/delsner/OpenCppCoverage).\n\n## Setup\n\n1. Download `OpenCppCoverage.exe` binary of [fork from OpenCppCoverage](https://github.com/delsner/OpenCppCoverage) (and add to `$PATH` if desired)\n2. Clone this repository and build it with `cmake` (you can use the internal version of VS)\n3. Make sure you can run `unittests.exe (tests\\unittests.exe)` with x64-Debug configuration\n4. Navigate to `.\\out\\build\\x64-Debug\\tests`, make sure there is a `unittests.pdb` and `unittests.exe` file and execute OpenCppCoverage as follows:\n```sh\n$ PATH_TO_OPENCPPCOVERAGE\\OpenCppCoverage.exe --sources libs --sources tests --excluded_sources tests\\cov_listener* --excluded_sources tests\\main* --enable_debug_callback -- unittests.exe\n```\n5. The outputted coverage for each test case should be in `.\\out\\build\\x64-Debug\\tests\\unittests\\runtimedump\\`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelsner%2Fcpp-test-specific-coverage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdelsner%2Fcpp-test-specific-coverage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelsner%2Fcpp-test-specific-coverage/lists"}