This project is read-only.

Introduction

NUnit.MultiCore provides a way to run existing NUnit tests in parallel. This is generally a 3 step process:
  1. Add a reference to NUnit.MultiCore.Interfaces in your test assembly
  2. Add "using NUnit.MultiCore" to your test fixture class
  3. Add the [Parallelizable] attribute to your test fixture class.

All test fixtures marked with the Parallelizable attribute will be run in parallel with each other. Any test fixtures which do not have the attribute will be run in a single thread, at a different time to the concurrent fixtures.

How to run the tests

NUnit.MultiCore comes with a console based test runner. This means running from the command line - "NUnit.MultiCore.ConsoleTestRunner [full path to test assembly] [/xml XmlOutputPath]". The xml output is in the same format that the standard NUnit console runner produces.

Running tests from Visual Studio

The purpose of creating the library was to make the build process go more quickly - the console test runner fits well enough into a build process, and Visual Studio integration hasn't really been a goal so far. However, existing test runners (such as TestDriven.NET and Resharper) can be used; however, the method by which this is achieved is not ideal:

  1. Add a reference to NUnit.MultiCore.TestRunner in your test assembly
  2. Add a new test class to your test assembly, which looks like:

using NUnit.Framework;
using NUnit.MultiCore.TestRunner;

namespace Example.Tests
{
    [TestFixture]
    class ParallelTester
    {
        [Test]
        public void RunTests() {
            new ParallelTestRunner().RunTestsInParallel();
        }
    }
}

Most test runners can then run just this individual test.  This test makes a call to the parallel test runner provider with NUnit.MultiCore, which then runs all of the tests within the test assembly.  This approach tends to work best with TestDriven.NET, where you don't need the [Test] and [TestFixture] attributes in the above - you can just right-click on the RunTests method above, and select to run it as a test.  The results will then be displayed in the output window within Visual Studio.

  

 



Last edited Aug 15, 2010 at 5:47 PM by David_001, version 22

Comments

atinchak Feb 23, 2013 at 12:00 PM 
Hi David,

Please suggest how to add [Parallelizable] attribute into the tests and how to run the tests from command line or any gui like (NUnit).

Thanks in Advanced!!
Atin