|
1 | 1 |  |
2 | | -# OpenCppCoveragePlugin |
3 | | -Official Visual Studio Plugin for OpenCppCoverage |
| 2 | +# OpenCppCoveragePlugin for VisualStudio2022 |
| 3 | +This is a fork of [Official Visual Studio Plugin for OpenCppCoverage](https://github.com/OpenCppCoverage/OpenCppCoveragePlugin). |
| 4 | +This works for me. But tests are broken. |
4 | 5 |
|
5 | 6 | **OpenCppCoverage** is an open source code coverage tool for C++ under Windows. You can find more information about this project [here](https://opencppcoverage.codeplex.com/). |
6 | 7 |
|
7 | 8 | This repository contains only the Visual Studio plugin sources. |
8 | 9 |
|
9 | 10 | ## Usage |
10 | 11 |
|
11 | | -To install and use this plugin, please see the [Visual Studio Gallery page](https://visualstudiogallery.msdn.microsoft.com/f45b8e13-f847-4b3b-92df-984df633b60e). |
12 | | -You can also install the NuGet package **OpenCppCoverage Plugin**. |
| 12 | +~~To install and use this plugin, please see the [Visual Studio Gallery page](https://visualstudiogallery.msdn.microsoft.com/f45b8e13-f847-4b3b-92df-984df633b60e). |
| 13 | +You can also install the NuGet package **OpenCppCoverage Plugin**.~~ |
13 | 14 |
|
14 | 15 | **Documentation is available [here](https://github.com/OpenCppCoverage/OpenCppCoveragePlugin/wiki)**. |
15 | 16 |
|
16 | | -For questions, you can create a discussion [here](https://opencppcoverage.codeplex.com/discussions). |
17 | | -If you find a bug, you can create an issue [here](https://opencppcoverage.codeplex.com/workitem/list/basic). |
| 17 | +~~For questions, you can create a discussion [here](https://opencppcoverage.codeplex.com/discussions). |
| 18 | +If you find a bug, you can create an issue [here](https://opencppcoverage.codeplex.com/workitem/list/basic).~~ |
18 | 19 |
|
19 | 20 | ## Development |
20 | 21 |
|
21 | 22 | ### Compilation |
22 | | -You have 2 Visual Studio solution files but **Visual Studio 2017 is always required**. |
23 | | -Please also make sure you have Visual Studio 2017 **version 15.8.X**. |
| 23 | +You have 2 Visual Studio solution files but **Visual Studio 2022 is always required**. |
| 24 | +Please also make sure you have Visual Studio 2022 **version 17.3.X**. |
24 | 25 |
|
25 | 26 | #### CppCoveragePlugin.sln |
26 | | -This is the default solution file and it requires only Visual Studio 2017. |
| 27 | +This is the default solution file and it requires only Visual Studio 2022. |
27 | 28 |
|
28 | 29 | #### CppCoveragePluginVS2013.sln |
29 | | -**This is a Visual Studio 2017 solution file** but it also requires: |
30 | | - * Visual Studio 2013 Update 5. |
31 | | - * [Microsoft Visual Studio 2013 SDK](https://visualstudiogallery.msdn.microsoft.com/842766ba-1f32-40cf-8617-39365ebfc134/view/). If you have any trouble to install the SDK, [this stack overflow question](https://stackoverflow.com/questions/22949411/visual-studio-2012-install-fails-program-compatibility-mode-is-on/23114542) can help. |
32 | | - * Visual Studio 2015 Update 3 may be required. |
| 30 | +~~**This is a Visual Studio 2017 solution file** but it also requires:~~ |
| 31 | + * ~~Visual Studio 2013 Update 5.~~ |
| 32 | + * ~~[Microsoft Visual Studio 2013 SDK](https://visualstudiogallery.msdn.microsoft.com/842766ba-1f32-40cf-8617-39365ebfc134/view/). If you have any trouble to install the SDK, [this stack overflow question](https://stackoverflow.com/questions/22949411/visual-studio-2012-install-fails-program-compatibility-mode-is-on/23114542) can help.~~ |
| 33 | + * ~~Visual Studio 2015 Update 3 may be required.~~ |
33 | 34 |
|
34 | | -This solution should be used only to generate a plugin compatible with Visual Studio 2013, 2015 and 2017. |
| 35 | +~~This solution should be used only to generate a plugin compatible with Visual Studio 2013, 2015 and 2017.~~ |
35 | 36 |
|
36 | 37 | #### OpenCppCoverage |
37 | | -You should install the latest version of [OpenCppCoverage](https://github.com/OpenCppCoverage/OpenCppCoverage/releases/tag/release-0.9.7.0): |
| 38 | +You should install the latest version of [OpenCppCoverage](https://github.com/OpenCppCoverage/OpenCppCoverage/releases/tag/release-0.9.9.0): |
38 | 39 | * *OpenCppCoverageSetup-x64-X.X.X.exe*: into *VSPackage\OpenCppCoverage-x64* |
39 | 40 | * *OpenCppCoverageSetup-x86-X.X.X.exe*: into *VSPackage\OpenCppCoverage-x86* |
40 | 41 |
|
41 | 42 | You can also copy past the binaries from an existing installation into these folders. |
42 | 43 | Binaries inside *VSPackage\OpenCppCoverage-x86* can be the same as *VSPackage\OpenCppCoverage-x64* (The opposite is not true). |
43 | 44 |
|
| 45 | +You also should copy msvcp140.dll and vcruntime140.dll from |
| 46 | +`C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE` |
| 47 | +to |
| 48 | +`\your\solution\directory\VSPackage\OpenCppCoverage-x64` and |
| 49 | +`\your\solution\directory\VSPackage\OpenCppCoverage-x86`. |
| 50 | + |
| 51 | +You also should copy Newtonsoft.Json.dll from |
| 52 | +`C:\Users\YourName\.nuget\packages\newtonsoft.json\13.0.1\lib\net45` |
| 53 | +to |
| 54 | +`\your\solution\directory\VSPackage\`. |
| 55 | + |
44 | 56 | ### Run the plugin |
45 | 57 |
|
46 | 58 | * Set *VSPackage* as *StartUp Project*. |
47 | 59 | * In *VSPackage Properties*, tab *Debug*: |
48 | | - * 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). |
| 60 | + * Select *Start external program* and set value to `C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.exe` (Update this path if you installed Visual Studio to another location). |
49 | 61 | * Add `/RootSuffix Exp` as *Command line arguments*. |
50 | 62 |
|
51 | 63 | If you have an issue when running the plugin, you can try to reset Visual Studio Experimental instance: |
52 | 64 |
|
53 | | -`"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VSSDK\VisualStudioIntegration\Tools\Bin\CreateExpInstance.exe" /Reset /VSInstance=15.0 /RootSuffix=Exp` |
| 65 | +`"C:\Program Files\Microsoft Visual Studio\2022\Communityy\VSSDK\VisualStudioIntegration\Tools\Bin\CreateExpInstance.exe" /Reset /VSInstance=17.0 /RootSuffix=Exp` |
54 | 66 |
|
55 | 67 | ### Run unit tests |
56 | 68 |
|
57 | 69 | You can run the tests with *Test Explorer window*. |
58 | | -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. |
59 | | -For *VSPackage_UnitTests* you need to do the same but with *UnitTests.testsettings*. |
| 70 | +~~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.~~ |
| 71 | + |
| 72 | +On Visual Studio 2022 *VSPackage_IntegrationTests* is broken because VSIDETestAdapter is deprecated and already erased. |
| 73 | + |
| 74 | +For *VSPackage_UnitTests* you need to do with *UnitTests.runsettings*. |
60 | 75 |
|
61 | 76 | If a test failed, you can try to run it again. You can also reset Visual Studio Experimental instance. |
0 commit comments