Automated module testing with NANT and VS2008 during the build process

I am using VS2008 Pro, and therefore my C # project includes a bunch of Unit Tests written in the MS unit test suite (sorry, I have no idea what its official name is!). I would like to be able to run these unit tests as part of my build process.

Can Nant get these unit tests to run automatically at build time?

+3
source share
2 answers

The solution that worked for me is the following:

<exec program ="C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe" >
    <arg value="/testcontainer:${Test_dll}"/>
    <arg value="/resultsfile:C:\Test\TestResults.trx"/>
</exec>

This is just the basic nant element, although it is as extensible as the MSTest command line allows.

+2
source

calld MSTest. exec :

( NAnt, , , . . ).

<exec>
    <executable>%VS_INSTALL%\Common7\IDE\MSTest.exe</executable>
    <baseDirectory>PPRJECT LOCATION</baseDirectory>
    <buildArgs>/testcontainer:TestDLLs /runconfig:localtestrun.Testrunconfig /resultsfile:testResults.trx</buildArgs>
    <buildTimeoutSeconds>600</buildTimeoutSeconds>
</exec>

, .

MSTest.

: VS2010, VS,

0

Source: https://habr.com/ru/post/1760528/


All Articles