Monocov did not generate output (OS X 10.7.4)

I am trying to use monocov to count the coverage of a unit test and have run into a problem, have had some exhausted google, but don't seem to have a corresponding answer.

I download and build monocs successfully, following these tips shown in this [question]: Unable to get monocons for compilation (Mac OS x 10.7.4)

Tried to use monocov along with nunit-console2, as indicated at http://www.mono-project.com/Code_Coverage

Here is my command:

$ MONO_OPTIONS="--profile=monocov:+/Users/myaccount/MyProject/MonoForm/MonoForm.Common.Generic/bin/Release" nunit-console2 /Users/myaccount/MyProject/MonoForm/MonoForm.Common.UnitTests/bin/Release/MonoForm.Common.UnitTests.dll 

And I got the output as:

 NUnit version 2.4.8 Copyright(C) 2002-2007 Charlie Poole. Copyright(C) 2002-2004 James W. Newkirk, Michael C.Two, Alexei A. Vorontsov. Copyright(C) 2000-2002 Philip Craig. All Rights Reserved. Runtime Environment - OS Version: Unix 11.4.0.0 CLR Version: 2.0.50727.1433 ( 2.10.9(tarball Mon May 7 20:25:51 EDT 2012) ) ...... Tests run: 6, Failures: 0, Not run: 0, Time: 0.052 seconds. $ 

I got TestResult.xml - this is the general output file nunit-console2, and as a result of the monoco there is no error message and the .cov file. Current stuck and did not understand what happened.

Not sure if any monk expert could shed any light here. Thanks!

+4
source share
1 answer

Well, it seems that Xamarin has removed the “internal” cov profiler, and monocov will not produce any output (besides monofile loading the shared library, no functions will be called) as the api changes.

They added a code coverage filter (April 7, 2015) to the main log profilers, and so far I have not been able to find any published documentation (?). Easy enough to turn on.

 --profile=log:coverage coverage enable collection of code coverage data covfilter=ASSEMBLY add an assembly to the code coverage filters add a + to include the assembly or a - to exclude it filter=-mscorlib covfilter-file=FILE use FILE to generate the list of assemblies to be filtered 

Git log information about removing cov and adding a log coverage filter:

 commit 16570265149730ec6a4760cc0fa34decc1a9d981 Author: Alex Rønne Petersen < alexrp@xamarin.com > Date: Tue Apr 7 14:51:27 2015 +0200 [profiler] Remove old mono-cov profiler. We're replacing this with coverage support in the log profiler. commit e91693fbb87f687a2fdb5a495c945c1872b3066c Author: iain holmes < iain@xamarin.com > Date: Fri Feb 27 10:13:54 2015 +0000 [cov] Install a coverage filter 
+1
source

Source: https://habr.com/ru/post/1438154/


All Articles