Opencover with multiple assemblies

Deadly 提交于 2020-01-12 12:48:25

问题


I am trying to combine three unit testing projects (three different dlls) into one OpenCover report. Is it possible? I tried to look into filters but I don't see enough detail (examples) in the OpenCover Wiki site. Can someone shed some lights on where I can start?

Thanks a lot!


回答1:


Yes it is possible. If you are using nunit (or some other test runner) you can (usually) run all test assemblies at the same time

e.g.

opencover.console.exe 
    -register:user 
    "-target:nunit-console.exe" 
    "-targetargs:test1.dll test2.dll /noshadow" 
    "-filter:+[*]* -[test*]*" 

alternatively if you are using different test runners (or multiple runs using the same test runner) then you can run them separately and merge the results using reportgenerator to create a single html report.

If you have any specific issues please comment below for clarification.




回答2:


Since november 2014 (v4.5.3427), the -mergeoutput option was added by @Shaun Wilde.

It allows to merge an existing file with the same name as defined with -output.




回答3:


You can give a chance to this powershell script https://github.com/rpokrovskij/opencover4vs.ps1/blob/master/opencover4vs.ps1

It will help you to atomize the work of creating those long "-targetargs:test1.dll test2.dll" parameters.



来源:https://stackoverflow.com/questions/22640885/opencover-with-multiple-assemblies

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!