Wednesday, April 1, 2009

Debugging Tests with Gallio

Here's the rundown of how to debug.

Icarus: Click the new "Debug" button in v3.0.6.

Visual Studio Team Test: Select the tests in the Test View and click Debug.  (This assumes that your test project has the appropriate ProjectTypeGuid to be recognized by Visual Studio as a Test Project.  See next post.)

TestDriven.Net: Right-click on a test or fixture and select "Test With... Debugger"

ReSharper: Select a test in the editor or test session view and use the Debug drop-down or toolbar button as appropriate.

Echo from command-line: Run tests with /debug argument. This will automatically attach to Visual Studio (or launch it if it is not running).

PowerShell: Use the "/DebugTests" switch for similar behavior to Echo.

NAnt: Add the debug="true" attribute for similar behavior to Echo.

MSBuild: Add the Debug="true" attribute for similar behavior to Echo.

It is no longer necessary to set the test runner type to IsolatedAppDomain if you use any of the above methods to run tests with the debugger.

On the other hand if you are attempting to attach to an existing test run of Gallio that was not started using any of the debugging mechanisms described above and the test runner type is IsolatedProcess (the default) be sure to attach to the Gallio.Host.exe or Gallio.Host.x86.exe process instead of Gallio.Icarus.exe or whatever.

No comments: