如何执行MsTest项目作为另一个项目的visual studio构建的一部分 [英] How to execute MsTest project as part of visual studio build of another projects

查看:86
本文介绍了如何执行MsTest项目作为另一个项目的visual studio构建的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 

我们有一个project1并添加了新的Test projectTest能够使用TestExplorer执行所有testmehods。现在我想在Visual Studio 2015中构建这个TestProject作为Project1构建的一部分。 

We have a project1 and added new Test projectTest am able to execute all testmehods using TestExplorer. Now I want to build this TestProject as part of Project1 build in visual studio 2015. 

当我们构建解决方案时,它还必须执行所有测试用例。如果任何测试用例失败,应该停止 

When we build solution it has to execute all test cases as well. if any test case fail build should stop 

charantej

charantej

推荐答案

嗨charantej,

Hi charantej,

欢迎来到MSDN论坛。

Welcome to MSDN forum.

首先,选择标签VS:

保持图标选择,然后VS 在每次构建后运行测试即可。

Keep the icon selected, then VS will run the test after every build.

第二次,将TestProject作为参考添加到
Project1 (您将构建):

Second, add the TestProject as reference to the Project1(which you will build):

右键单击参考 - >添加引用:

Right click Reference -> add reference:

 

之后,每次构建Project1时,TestProject也会运行。

After, every time you build the Project1, the TestProject will run as well.

您可以获取更多信息这个:

You could get more information about this:

https://msdn.microsoft.com/en-us/library/hh270865.aspx?f=255&MSPPError=-2147217396

如果您需要更多帮助,请随时告诉我。

Feel free to let me know if you need more help.

祝你好运,

Fletch


这篇关于如何执行MsTest项目作为另一个项目的visual studio构建的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆