开发者

Attaching MonoDevelop debugger to NUnit test run on OS X

Question 开发者_运维知识库as per the title really.

I'm looking for a way to step through running unit tests using MonoDevelop on OS X in the same way you can with Visual Studio (by attaching the debugger manually to the nunit process).

If this is possible on MonoDevelop (on OS X) then it's not obvious how. Would appreciate any pointers.


Build your code as normal, then copy the exes, dlls and mdb files to your other computer.

On your debugger host set the following environment variable and run monodevelop:

$ export MONODEVELOP_SDB_TEST=1
$ monodevelop

(you might need to edit the actual script that monodevelop is launched with and add the first line)

Fire up monodevelop, load your solution, set a break point and then click Run > Debug With > Custom Mono Soft Debugger.

Once the dialog appears, replace 127.0.0.1 with the IP of your debugger. Then click "Listen"

Then, on the other host run :

$ mono --debug \
  --debugger-agent=transport=dt_socket,address=IP:PORT \
  nunit.console.exe yourtest.dll

Replace IP and PORT with the values given on the debugger.


So you are wanting to run NUnit and then attach to the running process?

I think the only way to debug NUnit tests are from within a MonoDevelop NUnit project. From there you can hit the Debug menu item, and it will start NUnit for you and handle your breakpoints, etc.

Note that you will have difficulty getting it to work with MonoTouch, see here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜