Skip to content

fix: add profiler integration article #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ start-docs.sh
watch.sh
LICENSE
to_delete.md
/.vs
/.vs
2 changes: 0 additions & 2 deletions integration/code-coverage/codecoverage-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,3 @@ Reinstalling or repairing the installation of a 3rd party profiler tool, as well

* [NCover]({%slug justmock/integration/ncover%})

* [OpenCover]({%slug justmock/integration/opencover%})

2 changes: 0 additions & 2 deletions integration/code-coverage/ncover.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,3 @@ Having the profilers linked must be enough for using both JustMock and NCover in

* [Code Coverage Tools]({%slug justmock/integration/codecoverage-tools%})

* [OpenCover]({%slug justmock/integration/opencover%})

47 changes: 0 additions & 47 deletions integration/code-coverage/opencover.md

This file was deleted.

2 changes: 1 addition & 1 deletion integration/justmock-console/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Run the tests with the JustMock profier existing in the specified path using .NE
justmock-console runadvanced -p "\full\path\to\default\Telerik.CodeWeaver.Profiler.dll" -c "dotnet" -a "test --no-build \"\path\to\JustMock.Tests\""
```

Run the tests with the JustMock profier existing in the specified path and OpenCover integration using Command Line Tool for Windows::
Run the tests with the JustMock profier existing in the specified path and [OpenCover]({%slug justmock/integration/profiler-integration%}) integration using Command Line Tool for Windows::

```bat
OpenCover.Console -target:"Telerik.JustMock.Console" -targetargs:"runadvanced -p \"\full\path\to\default\Telerik.CodeWeaver.Profiler.dll\" -c vstest.console -a vstest \"\full\path\to\JustMock.Tests.dll\" -l" -output:opencovertests.xml
Expand Down
37 changes: 37 additions & 0 deletions integration/justmock-console/profiler-integrations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: Third-party Profilers Integration
page_title: Third-party Profilers Integration | JustMock Documentation
description: Integrate Telerik JustMock with third-party profilers
slug: justmock/integration/profiler-integration
tags: profiler
published: True
position: 4
previous_url: /integration-justmock-console-profiler-integration, /integration-justmock-console-profiler-integration.html
---

# Third-party Profilers Integration

This article explains how to integrate third-party profilers with the profiler used by JustMock. In most cases, integration is handled automatically through the [JustMock Configuration Tool]({%slug justmock/integration/codecoverage-tools%}), which allows users to enable supported profilers with a simple checkbox. However, when a profiler is not listed or auto-detection fails, JustMock provides a manual method for linking external profilers using the `--link-existing-profiler` (`-l`) option in the JustMock Console.

## Generic Command Structure

To link JustMock with an external profiler, users should invoke the external profiler’s console application and set the `-target` to Telerik.JustMock.Console.exe.
The `-targetargs` parameter must include the JustMock execution command, starting with `runadvanced`, followed by `-c` to specify the test runner (e.g., vstest.console.exe), and `-a` to provide the full path to the test assembly (e.g., MyTests.dll).
The profiler paths for 32-bit and 64-bit architectures must be provided using `--profiler-path-32` and `--profiler-path-64`, followed by `-l` to enable linking.

```bat
"full\path\to\ProfilerTool.Console.exe" -target:"%JUSTMOCK_BINARY_PATH%\Telerik.JustMock.Console.exe" -targetargs:"runadvanced -c \"full\path\to\vstest.console.exe\" -a \"full\path\to\MyTests.dll\" --profiler-path-32 \"%JUSTMOCK_PACKAGE_PATH%\CodeWeaver\32\Telerik.CodeWeaver.Profiler.dll\" --profiler-path-64 \"%JUSTMOCK_PACKAGE_PATH%\CodeWeaver\64\Telerik.CodeWeaver.Profiler.dll\" -l"
```

**Note:** Before executing the command, ensure that:
- The profiling tool is downloaded and extracted.
- JustMock is installed.
- Your solution and test project are ready.

## OpenCover Example

For a clearer understanding of how to structure this integration, the following example demonstrates how JustMock can be linked with `OpenCover` using a fully composed command.

```bat
"C:\Program Files (x86)\OpenCover\OpenCover.Console.exe" -target:"%JUSTMOCK_BINARY_PATH%\Telerik.JustMock.Console.exe" -targetargs:"runadvanced -c \"C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\TestPlatform\vstest.console.exe\" -a \"C:\Users\Administrator\source\repos\MyTests\MyTests\bin\Debug\net8.0\MyTests.dll\" --profiler-path-32 \"%JUSTMOCK_PACKAGE_PATH%\CodeWeaver\32\Telerik.CodeWeaver.Profiler.dll\" --profiler-path-64 \"%JUSTMOCK_PACKAGE_PATH%\CodeWeaver\64\Telerik.CodeWeaver.Profiler.dll\" -l"
```