tags:

views:

214

answers:

2

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?

+1  A: 

You may use msbuild runner. Please see http://stackoverflow.com/questions/938347/how-to-integrate-mspec-with-ms-build for description on how to integrate msbuild and mspec

Eugene Petrenko
Thanks Eugene. I came across that answer as well. I was hoping to do it using the sln2008 runner.
Bob Banks
Feel free to post an issue to tracker at http://youtrack.jetbrains.net
Eugene Petrenko
A: 

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 (http://stackoverflow.com/questions/938347/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>
aaronjensen
Interesting. I hadn't thought of that. Thanks Aaron! I'll give it a shot.
Bob Banks
No problem, let me know if it works out. That said, unless you have a very good reason for sticking to the sln2008 runner I'd toss that goal aside and use msbuild or rake (I *much* prefer rake).
aaronjensen