代码之家  ›  专栏  ›  技术社区  ›  nportelli

如何在路径中使用空格来运行partcover?

  •  0
  • nportelli  · 技术社区  · 14 年前

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

    “C:\Program Files\Gubka Bob\PartCover .NET 2\partcover.exe--目标 “C:\程序文件\Microsoft Visual Studio 9.0\common7\ide\mstest.exe“ --目标args“/noisolation”“/testcontainer:c:\ci\hudson\jobs\video raffle\workspace\source\videorafflecaller\source\videorafflecaller.test.unit\bin\debug\videorafflecaller.test.unit.dll“ --包括“[videorafflecaller**”--output“coverage\partcover.xml”

    我知道这个错误

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

    世界跆拳道联盟?看起来partcover不能很好地处理--target参数中的空格。还是我在某处遗漏了一些报价?有人做过类似的工作吗?

    1 回复  |  直到 14 年前
        1
  •  1
  •   Peter Schuetze    14 年前

    你完全正确,你忘了引用路径。阅读 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 (\)
    

    所以尝试将testcontainer参数更改为

    “/testcontainer:\”c:\ci\hudson\jobs\video raffle\workspace\source\videorafflecaller\source\videorafflecaller.test.unit\bin\debug\videorafflecaller.test.unit.dll \”