{"id":27732106,"url":"https://github.com/microsoft/codecoverage","last_synced_at":"2025-05-16T05:02:12.055Z","repository":{"id":65462790,"uuid":"589552985","full_name":"microsoft/codecoverage","owner":"microsoft","description":"Microsoft Code Coverage tools documentation and samples","archived":false,"fork":false,"pushed_at":"2025-04-17T11:09:04.000Z","size":11517,"stargazers_count":93,"open_issues_count":17,"forks_count":12,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-05-15T00:07:48.443Z","etag":null,"topics":["code-coverage"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-01-16T11:47:33.000Z","updated_at":"2025-04-21T16:56:11.000Z","dependencies_parsed_at":"2025-04-28T10:55:31.235Z","dependency_job_id":null,"html_url":"https://github.com/microsoft/codecoverage","commit_stats":{"total_commits":9,"total_committers":4,"mean_commits":2.25,"dds":0.4444444444444444,"last_synced_commit":"f2dcad3aaba81af4878d13b52908cffe485f015a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fcodecoverage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fcodecoverage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fcodecoverage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fcodecoverage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/codecoverage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254254041,"owners_count":22039792,"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":["code-coverage"],"created_at":"2025-04-28T10:04:56.341Z","updated_at":"2025-05-16T05:02:12.043Z","avatar_url":"https://github.com/microsoft.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Microsoft code coverage tools\n\nMicrosoft code coverage functionality is closed source. This repository contains documentation and samples. You can also use it to report any issues related to `Microsoft.CodeCoverage` NuGet package, `dotnet-coverage` NuGet package or Visual Studio code coverage functionality.\n\n## Get started\n\nTo collect code coverage for .NET test project you can simply execute:\n\n```shell\ndotnet new mstest -o mstests\ncd mstests\ndotnet test --collect \"Code Coverage;Format=cobertura\"\n```\n\nYou should see output:\n\n```shell\nDetermining projects to restore...\n  All projects are up-to-date for restore.\n  mstests -\u003e D:\\mstests\\bin\\Debug\\net8.0\\mstests.dll\nTest run for D:\\mstests\\bin\\Debug\\net8.0\\mstests.dll (.NETCoreApp,Version=v8.0)\nMicrosoft (R) Test Execution Command Line Tool Version 17.8.0 (x64)\nCopyright (c) Microsoft Corporation.  All rights reserved.\n\nStarting test execution, please wait...\nA total of 1 test files matched the specified pattern.\n\nPassed!  - Failed:     0, Passed:     1, Skipped:     0, Total:     1, Duration: 16 ms - mstests.dll (net8.0)\n\nAttachments:\n  D:\\mstests\\TestResults\\caf685fa-04ce-4858-9feb-ae472f1a71e1\\dd166e58-6e19-4741-931a-816d025fcb32.cobertura.xml\n```\n\nFor any .NET application you can collect code coverage in this way:\n\n```shell\ndotnet new console -o sample1\ncd sample1\ndotnet tool install -g dotnet-coverage\ndotnet-coverage collect \"dotnet run\"\n```\n\nYou should see output:\n\n```shell\ndotnet-coverage v17.13.1.0 [win-x64 - .NET 9.0.2]\n\nSessionId: d1bf31db-f634-4b2c-a627-c708ac93d85b\nHello, World!\nCode coverage results: output.coverage.\n```\n\nFor existing projects to get latest features and best performance please keep up to date below references:\n\n```xml\n\u003cPackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"17.13.0\" /\u003e\n\u003cPackageReference Include=\"Microsoft.CodeCoverage\" Version=\"17.13.0\" /\u003e\n```\n\nIf your solution doesn't contain any C++ code it is recommended to disable native code coverage by adding into configuration below flags:\n\n```xml\n\u003cEnableStaticNativeInstrumentation\u003eFalse\u003c/EnableStaticNativeInstrumentation\u003e\n\u003cEnableDynamicNativeInstrumentation\u003eFalse\u003c/EnableDynamicNativeInstrumentation\u003e\n```\n\nCheck other configuration options [here](docs/configuration.md).\n\n## Documentation\n\n* Documentation for `dotnet-coverage` tool is available [here](https://aka.ms/dotnet-coverage).\n* Documentation for `Microsoft.CodeCoverage` is available [here](https://learn.microsoft.com/visualstudio/test/customizing-code-coverage-analysis)\n* [Supported OS versions](docs/supported-os.md)\n* [Configuration](docs/configuration.md)\n* [Performance data](/docs/performance/README.md)\n\n## Samples\n\n* [Unit tests, E2E, console applications, merging, exclusions, static instrumentation](samples/Calculator/README.md)\n* [MSTest Runner, Native AOT](samples/Algorithms/README.md)\n* [Visual Studio](samples/VisualStudio/README.md)\n\n## Contributing\n\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit [Contributor License Agreements](https://opensource.microsoft.com/cla/).\n\nWhen you submit a pull request, a CLA bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n## Trademarks\n\nThis project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft\ntrademarks or logos is subject to and must follow\n[Microsoft's Trademark \u0026 Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).\nUse of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.\nAny use of third-party trademarks or logos are subject to those third-party's policies.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fcodecoverage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2Fcodecoverage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fcodecoverage/lists"}