Can Visual Studio 2012 run unit tests in parallel?

2019-01-18 03:53发布

Can Visual Studio 2012 run unit tests in parallel? Visual Studio 2010 has an option to do this:

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.

4条回答
我命由我不由天
2楼-- · 2019-01-18 04:09

I have a test project upgraded from 2010 to 2012. It won't run in parallel in the IDE, but using mstest.exe with the test DLL works fine.

查看更多
Melony?
3楼-- · 2019-01-18 04:10

No. VS2012 unit test framework currently does not run tests in parallel.

Edit: Moving a part of the comments with Dave into the answer for better reference.

See this link on how to enable parallel runs using the .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.

查看更多
时光不老,我们不散
4楼-- · 2019-01-18 04:11

Visual Studio 2012 doesn't allow to run tests in parallel.

But you can try ParallelTestRunner tool to run Visual Studio 2012/2013/2015 tests in parallel from the command line.

查看更多
疯言疯语
5楼-- · 2019-01-18 04:12

You can force VS2012 to use the 2010 test settings file. You can add FileName.testsettings into the 2012 .runsettings file. This is considered legacy and probably won't be supported forever.

e.g.

<MSTest>
 <CaptureTraceOutput>True</CaptureTraceOutput>
 <DeploymentEnabled>False</DeploymentEnabled>
 <SettingsFile>FILENAME.testsettings</SettingsFile>
 <ForcedLegacyMode>True</ForcedLegacyMode>
</MSTest>
查看更多
登录 后发表回答