Skip to content

Commit

Permalink
Merge pull request #134 from jakubch1/main
Browse files Browse the repository at this point in the history
C++ static code coverage examples
  • Loading branch information
jakubch1 authored Sep 4, 2024
2 parents cdcbd26 + 8d0c2ef commit 115316f
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 0 deletions.
2 changes: 2 additions & 0 deletions samples/VisualStudio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
3. [**Scenario 03** Merge coverage reports](scenarios/scenario03/README.md)
4. [**Scenario 04** Coverage report views](scenarios/scenario04/README.md)
5. [**Scenario 05** Search](scenarios/scenario05/README.md)
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)
30 changes: 30 additions & 0 deletions samples/VisualStudio/scenarios/scenario06/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Scenario Description

Static C++ code coverage for [google test adapter](https://github.com/microsoft/TestAdapterForGoogleTest) samples tests in Visual Studio.

## Collect C++ code coverage

1. Clone [google test adapter](https://github.com/microsoft/TestAdapterForGoogleTest) repository

```shell
git clone https://github.com/microsoft/TestAdapterForGoogleTest.git
```

2. Open solution in Visual Studio Enterprise

```shell
cd TestAdapterForGoogleTest/SampleTests
start SampleTests.sln
```

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

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

4. Collect code coverage using **Analyze Code Coverage for All Tests** in the **Test** menu

![alt text](analyze.png "Test menu with Analyze Code Coverage for All Tests command.")

5. 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.
23 changes: 23 additions & 0 deletions samples/VisualStudio/scenarios/scenario07/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Scenario Description

Static C++ code coverage for new Native Unit Test project in Visual Studio ARM64.

## Collect C++ code coverage on ARM64 system

1. Open Visual Studio Enterprise

2. Create new Native Unit Test project.

![alt text](create.png "Create Native Unit Test Project.")

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

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

4. Collect code coverage using **Analyze Code Coverage for All Tests** in the **Test** menu

![alt text](analyze.png "Test menu with Analyze Code Coverage for All Tests command.")

5. 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.

0 comments on commit 115316f

Please sign in to comment.