Question

I'm currently using the sln2008 runner. Is there a way to configure TeamCity to execute MSpec tests without switching to a NAnt or MSBuild runner?

Was it helpful?

Solution

I've never done it, but you could probably add a post build Exec task that just shelled out to mspec.exe. Just throw the code from my answer linked to above (How to integrate MSpec with MS Build?) in your specs csproj and add DependsOnTargets="RunSpecs" to your AfterBuild target:

  <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>

OTHER TIPS

You may use msbuild runner. Please see How to integrate MSpec with MS Build? for description on how to integrate msbuild and mspec

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top