Search code examples
visual-studiovisual-studio-2008unit-testingmulticore

Do Unit Tests target Multiple Cores in Visual Studio?


As our unit test numbers increase we are finding it increasingly difficult to continually run all the tests on our developer machines. Does anyone know if Visual Studio 2008:

  1. natively targets multiple cores
  2. doesn't target multiple cores automatically, but it's configurable
  3. doesn't target multiple cores at all

Solution

  • Tests are run in a single thread, so only one core is used. This is the desired behavior, as having them run on more threads might cause the tests to behave unexpectedly if you're using static variables, or any type of global state (for instance, a test changes a static variable, and when it ends changes it back. If another test is running at the same time, it might see a different value than it expects).