Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

About

Migration of OpenCppCoverage Plugin for Visual Studio 2026

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

235 Commits

Folders and files

Repository files navigation

OpenCppCoveragePlugin

Official Visual Studio Plugin for OpenCppCoverage

VS2026 Fork Note

This repository is based on the Mato-89 Visual Studio 2022 fork of OpenCppCoveragePlugin and extends it towards practical usability with Visual Studio 2026.

Main changes compared to the Mato-89 fork:

  • more defensive handling of Visual Studio automation / VC project objects
  • more robust ProgramToRun resolution using: DebugSettings.Command -> PrimaryOutput -> TargetPath -> OutDir/TargetName/TargetExt -> MSBuild evaluation
  • old fragile project.Files / VCProjectEngine-based file discovery intentionally kept disabled
  • empty persisted startup settings no longer overwrite auto-detected values
  • optional persistent diagnostic .cov export
  • optional persistent OpenCppCoverage process log
  • pragmatic default source excludes to reduce noise from Boost, toolchain and third-party headers

Important note: This fork prioritizes stable and conservative behavior under Visual Studio 2026 over restoring older automation-heavy logic that proved unreliable or unstable.

Known limitation: Source-root detection for build-tree-generated projects is still not fully general and remains an area for future improvement.

OpenCppCoverage is an open source code coverage tool for C++ under Windows. You can find more information about this project here.

This repository contains only the Visual Studio plugin sources.

Usage

To install and use this plugin, please see the Visual Studio Gallery page. You can also install the NuGet package OpenCppCoverage Plugin.

Documentation is available here.

For questions, you can create a discussion here. If you find a bug, you can create an issue here.

Development

Compilation

You have 2 Visual Studio solution files but Visual Studio 2017 is always required. Please also make sure you have Visual Studio 2017 version 15.8.X.

CppCoveragePlugin.sln

This is the default solution file and it requires only Visual Studio 2017.

CppCoveragePluginVS2013.sln

This is a Visual Studio 2017 solution file but it also requires:

This solution should be used only to generate a plugin compatible with Visual Studio 2013, 2015 and 2017.

OpenCppCoverage

You should install the latest version of OpenCppCoverage:

  • OpenCppCoverageSetup-x64-X.X.X.exe: into VSPackage\OpenCppCoverage-x64
  • OpenCppCoverageSetup-x86-X.X.X.exe: into VSPackage\OpenCppCoverage-x86

You can also copy past the binaries from an existing installation into these folders. Binaries inside VSPackage\OpenCppCoverage-x86 can be the same as VSPackage\OpenCppCoverage-x64 (The opposite is not true).

Run the plugin

  • Set VSPackage as StartUp Project.
  • In VSPackage Properties, tab Debug:
    • Select Start external program and set value to C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe (Update this path if you installed Visual Studio to another location).
    • Add /RootSuffix Exp as Command line arguments.

If you have an issue when running the plugin, you can try to reset Visual Studio Experimental instance:

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VSSDK\VisualStudioIntegration\Tools\Bin\CreateExpInstance.exe" /Reset /VSInstance=15.0 /RootSuffix=Exp

Run unit tests

You can run the tests with Test Explorer window. To run VSPackage_IntegrationTests you need to expand Solution items in Solution Explorer and set Active Load and Web Test Settings for IntegrationTests.testsettings. If you have a COM error when running tests, you can select IntegrationTests.testsettings file from Visual Studio menu: Test/Test Settings/Select Test Settings File. For VSPackage_UnitTests you need to do the same but with UnitTests.testsettings.

If a test failed, you can try to run it again. You can also reset Visual Studio Experimental instance.

About

Migration of OpenCppCoverage Plugin for Visual Studio 2026

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages