mono / sdb

A command line client for the Mono soft debugger.
https://www.mono-project.com
MIT License
116 stars 44 forks source link

Is it possible to debug NUnit tests? #36

Closed PapaMufflon closed 7 years ago

PapaMufflon commented 7 years ago

I tried to do so under Ubuntu with the following command:

sdb "args debug-test.dll" "run nunit3-console.exe"

I put a System.Diagnostics.Debugger.Break() inside a test, but it does not break there. NUnit runs successfully to the end instead. I surely missed something here or isn't it possible at all?

alexrp commented 7 years ago

It should work. The only way I can imagine the breakpoint is being lost is if NUnit runs the tests in a sub-process that isn't set up for debugging or something.

PapaMufflon commented 7 years ago

Would sdb show me if NUnit starts a sub-process? I can only see Inferior process '26564' ('nunit3-console.exe') started.

Btw, sdb breaks on a trivial hello world executable correctly.

alexrp commented 7 years ago

No, I'd recommend checking something like htop to see if any sub-processes are spawned.

PapaMufflon commented 7 years ago

Uuuh, yes. A nunit-agent gets spawned. d'oh Passing a --inprocess argument for nunit3-console.exe solves that issue. Thank you for the help!