Skip to content

Commit

Permalink
C++ native code coverage for console app
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Chocholowicz committed Sep 9, 2024
1 parent d18c406 commit 5223496
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions samples/VisualStudio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
6. [**Scenario 06** C++ code coverage in Visual Studio](scenarios/scenario06/README.md)
7. [**Scenario 07** C++ code coverage in Visual Studio ARM64](scenarios/scenario07/README.md)
8. [**Scenario 08** Static code coverage for ASP.NET Core Web App (Razor Pages) in IIS](scenarios/scenario08/README.md)
9. [**Scenario 09** C++ code coverage for Console App in Developer PowerShell for VS Enterprise](scenarios/scenario09/README.md)
29 changes: 29 additions & 0 deletions samples/VisualStudio/scenarios/scenario09/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Scenario Description

Static C++ code coverage for new Native Console App project in Visual Studio.

## Collect C++ code coverage Console App

1. Open Visual Studio Enterprise

2. Create new Native Console App project.

![alt text](create.png "Create C++ Console App Project.")

3. Enable **Profile** (Configuration Properties->Linker->Advanced) flag for all projects in solution

![alt text](profile-flag.png "Profile linker flag.")

4. Build solution

![alt text](build.png "Build solution")

5. Collect code coverage in Developer PowerShell for VS Enterprise
```console
Microsoft.CodeCoverage.Console.exe collect --include-files .\x64\Debug\** .\x64\Debug\ConsoleApplication1.exe
```
![alt text](collect.png "Collect code coverage")

6. View code coverage results

![alt text](results.png "Code coverage results.")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5223496

Please sign in to comment.