TeamCity& MSpec与sln2008跑步者?

时间:2009-10-19 03:52:03

标签: teamcity mspec

我目前正在使用sln2008跑步者。有没有办法配置TeamCity执行MSpec测试而不切换到NAnt或MSBuild运行器?

2 个答案:

答案 0 :(得分:1)

您可以使用msbuild runner。有关如何集成msbuild和mspec

的说明,请参阅How to integrate MSpec with MS Build?

答案 1 :(得分:1)

我从来没有这样做过,但是你可能会添加一个post build build Exec任务,它刚刚发布到mspec.exe。只需在您的规范csproj中将我上面链接的代码(How to integrate MSpec with MS Build?)中的代码抛出,并将DependsOnTargets =“RunSpecs”添加到AfterBuild目标中:

  <Target Name="RunSpecs">
    <PropertyGroup>
      <MSpecCommand>
        lib\machine\specifications\Machine.Specifications.ConsoleRunner.exe $(AdditionalSettings) path\to\your\project\bin\Debug\Your.Project.Specs.dll path\to\your\other\project\bin\Debug\Your.Other.Project.dll 
      </MSpecCommand>
    </PropertyGroup>
    <Message Importance="high" Text="Running Specs with this command: $(MSpecCommand)"/>
    <Exec Command="$(MSpecCommand)" />
  </Target>
  <Target Name="AfterBuild" DependsOnTargets="RunSpecs">
  </Target>