Attempting to state multiple targetargs (dlls) from one solution in OpenCover.Console.exe process...

Oct 6, 2014 at 8:03 PM
Edited Oct 6, 2014 at 8:03 PM
We've moved our tests from one monolithic test project to two. One represents our Unit tests, the other for integration.
What I'm hoping to do is combined these two test targets in the one execution of OpenCover.Console.exe which should be able to get a full account of our code coverage for our entire solution.
I'm reasonably sure this is/should be possible, but I'm having problems getting this working.
Here's my command line strategy for running the two together:
C:\work\OpenCover>OpenCover.Console.exe -target:[3rdParty]\xunit.1.9.2\xunit.console.clr4.exe -targetargs:"[SourceRoot]\Test.Unit\bin\Debug\Test.Unit.dll [SourceRoot]\Test.Integration\bin\Debug\Test.Integration.dll /noshadow" -output:"c:\temp\cooltests.xml"
and when I execute this I get a ton of errors that essentially reports:
System.Configuration.ConfigurationErrorsException : Configuration system failed to initialize
If I run each individually there are no such problems, both run clean. Is there something in my syntax that's incorrect?
If you'd like a full stack trace, I can provide.
thanks.
Coordinator
Oct 7, 2014 at 6:38 AM
As I understand it I don't believe xunit can run against multiple assemblies - you have to do them one at a time. Have you tried running multiple assemblies without using opencover?

What you need to do for now is either
a) run each assembly producing a different opencover output file and then use ReportGenerator to merge them together for reporting purposes, or
b) create a batch file that has 1 xunit execution per assembly and then get opencover to execute that batch file.

Shaun
Oct 7, 2014 at 3:54 PM
Hey Shaun, Well that would make sense given the errors I've been getting. I've seen mention of merging as you recommend here in option a. I'll give that a go today.
Thanks for the feedback.