Problem running NUnit with MSBuild

Hi,

I am using F# with NUnit and MSBuild.
If I use the sln2008-runner in Team City with the integrated NUnit-Runner everything works fine, but if I use my msbuild-script TeamCity (or Nunit) is ignoring all tests (because of abstract classes).
If I run the build-script manually Nunit runs all tests.

This is my build script:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <!-- Import the MSBuild Tasks -->
  <Import Project="c:\Program Files (x86)\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <ClassLibraryOutputDirectory>bin\$(Configuration)</ClassLibraryOutputDirectory>
    <ProjectDir>src\app\NaturalSpecLib</ProjectDir >
    <ProjectTestDir>src\test\Spec.NaturalSpec</ProjectTestDir >
    <ProjectFile>$(ProjectDir)\NaturalSpecLib.fsproj</ProjectFile >
    <TestProjectFile>$(ProjectTestDir)\Spec.NaturalSpec.fsproj</TestProjectFile>
    <NUnit-ToolPath>.\Tools\NUnit\bin</NUnit-ToolPath>
  </PropertyGroup>


  <!-- Build projects by calling the Project files generated by VS -->
  <Target Name="Build" >
    <MSBuild Projects="$(ProjectFile)"   />
    <MSBuild Projects="$(TestProjectFile)" />
  </Target>

  <!-- Run Unit tests -->
  <Target Name="Test" DependsOnTargets="Build">
    <CreateItem Include="$(ProjectTestDir)\$(ClassLibraryOutputDirectory)\Spec.NaturalSpec.dll">
      <Output TaskParameter="Include" ItemName="TestAssembly" />
    </CreateItem>
  
    <NUnit Assemblies="@(TestAssembly)" ToolPath="$(NUnit-ToolPath)" />
  </Target>
</Project>

If needed I could create a minimal sample.

Best regards,
forki

Please sign in to leave a comment.