FineCodeCoverage icon indicating copy to clipboard operation
FineCodeCoverage copied to clipboard

Set the target for OpenCover

Open tonyhallett opened this issue 2 years ago • 1 comments

As per @BOnstwedder request

Last I was wondering if it were possible to set the target for opencover, as it would be nice to set this to our locally installed nunit3console exe

in https://github.com/FortuneN/FineCodeCoverage/issues/136#issuecomment-842292976

@FortuneN

I was going to add an option for the register argument as there appears to be a requirement for it https://github.com/FortuneN/FineCodeCoverage/issues/167 and https://github.com/FortuneN/FineCodeCoverage/issues/191#issuecomment-971342401.

Apparently below is not sufficient.

project.Is64Bit = container.TargetPlatform.ToString().ToLower().Equals("x64");

• -register[:user] - Use this switch to register and de-register the code coverage profiler. Alternatively use the optional user argument to do per-user registration where the user account does not have administrative permissions. Alternatively use an administrative account to register the profilers using the regsvr32 utility. If you do not want to use the registry entries, use -register[:Path32] or -register[:Path64]to let OpenCover select the profiler for you. Depending on your choice it selects the <OpenCoverAssemblyLocation>/x86/OpenCover.Profiler.dll or <OpenCoverAssemblyLocation>/x64/OpenCover.Profiler.dll. You should also consider using path32 and path64 options when profiling .net core targeted applications and .net 4.8 framework.

How would you like to proceed on the register argument, target ( and target args ) and additional arguments that we do not provide ?

tonyhallett avatar Nov 18 '21 14:11 tonyhallett

The assumption was that we could auto determine what is required.

Since, it seems, we cannot do that in all cases we could allow manual input to override the automatic default. If we know something new we should continue to improve the automatic default so that manual input is required for a minority of cases.

FortuneN avatar Nov 21 '21 23:11 FortuneN

Available in latest version

tonyhallett avatar Jan 17 '24 20:01 tonyhallett