views:

117

answers:

1

I have a msbuild file that I'm trying to run from Hudson CI. It outputs like this

"C:\Program Files\Gubka Bob\PartCover .NET 2\PartCover.exe" --target "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe" --target-args "/noisolation" "/testcontainer:C:\CI\Hudson\jobs\Video Raffle\workspace\Source\VideoRaffleCaller\Source\VideoRaffleCaller.Test.Unit\bin\Debug\VideoRaffleCaller.Test.Unit.dll" --include "[VideoRaffleCaller*]*" --output "Coverage\partcover.xml"

I get this error

Invalid switch "raffle\workspace\source\videorafflecaller\source\videorafflecall er.test.unit\bin\debug\videorafflecaller.test.unit.dll". For switch syntax, type "MSTest /help"

WTF? Looks like PartCover doesn't handle spaces in the --target-args well. Or am I missing some quotes somewhere? Has anyone gotten something like to to work?

+1  A: 

You are completely right that you forgot to quote the path. Read the guide on how to integrate PartCover with MSBuild.

--target-args=
Argument specifies arguments for target process. If target argument 
contains spaces - quote . If you want specify quote (") in , then 
precede it by slash (\)

So try to change your testcontainer parameter to

"/testcontainer:\"C:\CI\Hudson\jobs\Video Raffle\workspace\Source\VideoRaffleCaller\Source\VideoRaffleCaller.Test.Unit\bin\Debug\VideoRaffleCaller.Test.Unit.dll\""

Peter Schuetze
Nope No go unfortunately. I get C:\CI\Hudson\jobs\Video Raffle\workspace\partcover.proj(26,158): error MSB4025: The project file could not be loaded. Name cannot begin with the '$' character, hexadecimal value 0x24. Line 26, position 158.
nportelli
As you see, it seemed to have worked. Check the internet for the Error thrown by MSBUILD (MSB4025) - Something with your Project configuration does not seem to be right. But MSBuild was executed. There are several different issues out on the internet for that error; Several for a misconfiguration of project files and at least one is a bug.
Peter Schuetze
You were right but in MSBuild you need to use " for a quote
nportelli