Now that Visual Studio 2010 has been released for a bit, consider upgrading to make use of the parallelTestCount
attribute in MSTest's .testsettings
file, as described at How to: Run Unit Tests Faster Using a Computer with Multiple CPUs or Cores.
There are a few limitations, such as:
- Only simple unit tests are supported (i.e. excludes coded UI tests and ASP.NET-hosted tests)
- Tests must be thread-safe (all tests are run in the same process)
- You can't collect code coverage (among other data & diagnostics) at the same time
Example, using 0 to mean auto-detect (the default is 1):
<?xml version="1.0" encoding="UTF-8"?>
<TestSettings
name="Release"
id="{GUID}"
xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Description>
These are default test settings for a local test run.
</Description>
<Execution parallelTestCount="0">
(...)
</Execution>
</TestSettings>
A few blogs have noted that you might have to close and re-open your project for Visual Studio to notice you added/changed that attribute. Also, if you edit the test settings file using the GUI, you'll probably have to re-add the parallelTestCount
attribute.