JustMock

This topic provides a step-by-step guide on how to integrate Telerik JustMock with PartCover. Visit https://github.com/sawilde/partcover.net4 to obtain the latest version.

PartCover is an open-source code coverage analysis tool for .NET environment. Code coverage helps you to determine whether your software has been completely tested. You can use it in detecting test cases that may have been omitted when writing the actual tests.

Pre-requisites

  1. Get the latest PartCover source code revision from https://github.com/sawilde/partcover.net4

  2. Visit http://www.boost.org/ and download Boost libraries

  3. Configure the PartCover solution and make sure you can compile it

Perform the following steps

  1. Find and open partcover_connector.cpp file from PartCover code base. In revision 32 this file is located in the $/trunk/main/PartCover.CorDriver folder.

  2. Find the following line

    CopyC++
    env[_T("Cor_Profiler")] = _T("{") _T(DRIVER_CORPROFILER_GUID) _T("}");

    and replace it with the following code block:

    CopyC++
    WCHAR envVar[100];
    ZeroMemory(envVar, sizeof(envVar));
    DWORD envVarLen = GetEnvironmentVariableW(L"Cor_Profiler", envVar, sizeof(envVar)/sizeof(WCHAR));
    
    if ((0 == envVarLen) && (envVarLen == wcslen(envVar)))
    env[_T("Cor_Profiler")] = _T("{") _T(DRIVER_CORPROFILER_GUID) _T("}");
    
    env[_T("TELERIK_SINK_PROFILER")] = _T("{") _T(DRIVER_CORPROFILER_GUID) _T("}");
  3. Compile PartCover

See Also