Search code examples
code-coverageopencover

Opencover with multiple assemblies


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!


Solution

  • 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.