首页 > 其他 > 详细

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

时间:2016-08-22 12:01:25      阅读:118      评论:0      收藏:0      [点我收藏+]

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>

 

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

原文:http://www.cnblogs.com/EasonJim/p/5794848.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!