0 Replies - 4320 Views - Last Post: 16 January 2013 - 05:14 AM Rate Topic: -----

#1 MarmiteX1  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 159
  • Joined: 17-October 09

Running MSTests with overnight build

Posted 16 January 2013 - 05:14 AM

Hi there,

I am using Visual Studio 2010 and TFS 2010. TFS2010 is installed on the Build Server. I am coding in C#.

Now I would like to run mstests as part of the build. I have a Project within a solution which basically generates a single unit test case dll using a tt(text template) file which contains all the test cases. Each method will go and then a specifc a test case.

At the moment they're not run as part of the build and i am trying to intergrate them into the build. I have put the following code in the project which contains a single file with all the generated tests:

</Target>
  <Target Name="AfterBuild">
    <Message Text="Running tests..."/>
    <PropertyGroup>
      <TestSuccessOrNot>1</TestSuccessOrNot>
    </PropertyGroup>
     <!-- Run MSTest exe-->
    <Exec Command='"$(VS100COMNTOOLS)..\IDE\mstest.exe" /testcontainer:..\..\..\..\_Libraries\Tests\MyTestProject.FunctionalTests.dll /runconfig:MyTestProject.FunctionalTests.config'>
      <Output TaskParameter="ExitCode" PropertyName="TestSuccessOrNot"/>
    </Exec>
    <Error Condition="$(TestSuccessOrNot) == 1" Text="Unit tests fail!" />
  </Target>



Firstly, is the above code correct and in the correct solution? i.e should it it be in the solution which generates the unit test cases in form of mstests?
Secondly, does anyone know how i can get further information about the tests that have failed?

If anyone could share please, it would be much appreciated.

Thanks in advance,

Is This A Good Question/Topic? 0
  • +

Page 1 of 1