简体   繁体   English

Visual Studio 2012可以并行运行单元测试吗?

[英]Can Visual Studio 2012 run unit tests in parallel?

Can Visual Studio 2012 run unit tests in parallel ? Visual Studio 2012可以并行运行单元测试吗? Visual Studio 2010 has an option to do this: Visual Studio 2010有一个选项可以执行此操作:

http://blogs.msdn.com/b/vstsqualitytools/archive/2009/12/01/executing-unit-tests-in-parallel-on-a-multi-cpu-core-machine.aspx http://blogs.msdn.com/b/vstsqualitytools/archive/2009/12/01/executing-unit-tests-in-parallel-on-a-multi-cpu-core-machine.aspx

...but I can't find anything similar in Visual Studio 2012. I tried the procedure described in the referenced article, but even loading the same test settings file I was unable to run tests in parallel. ...但我在Visual Studio 2012中找不到类似的东西。我尝试了参考文章中描述的过程,但即使加载相同的测试设置文件,我也无法并行运行测试。

No. VS2012 unit test framework currently does not run tests in parallel. VS2012单元测试框架目前没有并行运行测试。

Edit : Moving a part of the comments with Dave into the answer for better reference. 编辑 :将部分评论与Dave一起移动到答案中以便更好地参考。

See this link on how to enable parallel runs using the .testsettings. 请参阅此链接 ,了解如何使用.testsettings启用并行运行。 Once you have this configured in your .testsettings file you can then set that as the active settings file in VS and this which will force the execution in the legacy mstest framework, where this feature is available. 在.testsettings文件中配置完成后,可以将其设置为VS中的活动设置文件,这将强制执行此功能可用的旧版mstest框架。

You can force VS2012 to use the 2010 test settings file. 您可以强制VS2012使用2010测试设置文件。 You can add FileName.testsettings into the 2012 .runsettings file. 您可以将FileName.testsettings添加到2012 .runsettings文件中。 This is considered legacy and probably won't be supported forever. 这被认为是遗留的,可能永远不会得到支持。

eg 例如

<MSTest>
 <CaptureTraceOutput>True</CaptureTraceOutput>
 <DeploymentEnabled>False</DeploymentEnabled>
 <SettingsFile>FILENAME.testsettings</SettingsFile>
 <ForcedLegacyMode>True</ForcedLegacyMode>
</MSTest>

我有一个测试项目从2010年升级到2012年。它不会在IDE中并行运行,但使用mstest.exe与测试DLL工作正常。

Visual Studio 2012 doesn't allow to run tests in parallel. Visual Studio 2012不允许并行运行测试。

But you can try ParallelTestRunner tool to run Visual Studio 2012/2013/2015 tests in parallel from the command line. 但您可以尝试使用ParallelTestRunner工具从命令行并行运行Visual Studio 2012/2013/2015测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM