NAnt打包使用MSTest进行单元测试的配置

NAnt比较老的持续集成工具了,对于它的文章都停留在09年左右的,只有一些github上的老项目上可以很多的看见是使用这个进行集成的,估计这个当时老外用的非常多吧。

如题,NAnt如果使用单元测试,用的最多的应该是NUnit,但是VS中新建的测试项目默认的就是MSTest,如果在使用过程中,没有指定MSTest的路径和依赖库,那么编译的时候就会报错,提示无法找到依赖。

想要解决的思路:1、指定依赖项目的路径。2、执行使用exec进行执行。

以下是我收集的资料:

http://codeissue.com/issues/i34dfa312fb52e7/how-to-execute-my-net-mstest-unit-test-from-nant-script-during-automated-build

最后附上配置节点:

<!--Visual Studio installation location-->
<property name="devenv.dir" value="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE" />
<!--Location of compiled output (dll/exe) which contains MSTest-->
<property name="unittest.dll" value="&quot;c:\mytestproject\bin\Release\mytestproject.dll&quot;" />
<!--Actual Task for executing MSTest unit test-->
<target name="ExecuteMSUnitTests" description="Execute unit tests using MSTest">
  <exec basedir="${devenv.dir}" workingdir="c:\mytestproject\" program="MSTest.exe" commandline="/testcontainer:${unittest.dll}" failonerror="true" />
</target>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值