繁体   English   中英

如何在路径中带有空格的情况下运行PartCover?

[英]How do you run PartCover with spaces in the path?

我有一个要从Hudson CI运行的msbuild文件。 它输出像这样

“ 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 * ] *“-输出” Coverage \\ partcover.xml“

我得到这个错误

无效的开关“ raffle \\ workspace \\ source \\ videorafflecaller \\ source \\ videorafflecall er.test.unit \\ bin \\ debug \\ videorafflecaller.test.unit.dll”。 对于开关语法,键入“ MSTest / help”

WTF? 看起来PartCover不能很好地处理--target-args中的空格。 还是我在某处缺少一些报价? 有没有人喜欢上班?

您完全正确,忘记了引用路径。 阅读有关如何将PartCover与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 (\)

因此,尝试将您的testcontainer参数更改为

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM