在mstest中设置测试套件的超时 [英] Setting timeouts for a test suite in mstest

查看:107
本文介绍了在mstest中设置测试套件的超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在mstest中为整个测试套件设置超时,还是为单个测试设置超时? 即,如果我希望套件X中测试的总运行时间不超过2分钟,怎么办?

Is there a way to set timeouts for a whole test suite in mstest, or just for individual tests? I.E., if I want the total running time of the tests in suite X to be no more than 2 minutes, how do I do that?

推荐答案

添加测试设置文件并更改超时设置.越过链接- 为Visual Studio测试指定测试设置

Add the test settings file and change the timeout settings. Go over link - Specifying Test Settings for Visual Studio Tests

将测试设置文件添加到解决方案中,然后选择要使用的文件.如果您希望能够在不同的设置之间快速切换,则可以添加多个测试设置文件.

Add test settings files to your solution, and then select the one you want to use. You can add more than one test settings file if you want to be able to switch quickly between different settings.

要设置测试超时-请执行以下操作

To set the Test TimeOuts - Do the following

  1. 要限制每次测试运行的时间段, 个别测试,请选择测试超时".测试设置中的页面 对话框.

  1. To limit the period of time for each test run and individual tests, choose the Test Timeouts. page in the Test Settings dialog box.

要在超过时间限制时中止测试运行,请选择中止测试" 如果总时间超过则运行,然后为该限制输入一个值.

To abort a test run when a time limit is exceeded, select Abort a test run if the total time exceeds and then type a value for this limit.

要在超出时间限制的情况下使单个测试失败,请选择标记为 如果单个测试的执行时间超过了该测试的失败,则键入a 此限制的值.

To fail an individual test if a time limit is exceeded, select Mark an individual test as failed if its execution time exceeds, and type a value for this limit.

这篇关于在mstest中设置测试套件的超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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