Just an hour or so ago, support landed on mozilla-central which gives us the ability to use the devtools debugger to debug xpcshell tests \o/

To use this, simply add "--jsdebugger" to the xpcshell/mach command-line - eg:

  ./mach xpcshell-test --jsdebugger path/to/a/test.js

then wait for the xpcshell process to start and to output a message indicating it is waiting for the debugger. Then from a (nightly, non-e10s - see below) Firefox instance, use devtools->connect to connect to the xpcshell process. WebIDE should also work.

Caveats:
* You can only use this to debug a single test, so specifying (eg) a directory of tests isn't going to work (you'll get an error starting the xpcshell process)

* Unrelated to this change, the devtools code recently changed such that earlier devtools clients can't debug newer servers - see bug 905700 and bug 1105493 - there's some talk of uplifting, but for now you need to use a Nightly Firefox to connect to the xpcshell tests. Also, last I checked things didn't work with e10s - so you need a Nightly with e10s disabled.

* There remain a few paper-cuts (eg, the "console" might not fully work) but in general, the debugger itself works fine.

Thanks to :gps for getting this ball rolling many months ago, and particularly to :past who patiently helped with the devtools magic that was necessary to get this working.

Spread the word!

Mark
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to