jae_63 has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I just moved to a new company, and would like to be able to use a decent debugger, preferably a graphical debugger, from the Mac on my desktop to a remote Linux system.
I’ve familiar with Devel::ptkdb, and this is my debugger of choice for this sort of work, and I was able to install it on the Linux system. But at least “out of the box” this isn’t a workable solution for much of the work, which involves creating lots of unit tests. These unit tests are implemented in a local set of modules, which are built around Test::More.
Due to the nature of Test::More and its brethren, and their heavy use of eval(), it’s not so easy to debug these unit tests using a debugger. Routinely such tests are invoked using a local script named runtests.pl, with command-line arguments include the unit test file, such as mytest.t. But since the debugger won’t know about mytest.t when the debugger is invoked, there is no obvious way to set breakpoints within the test.
I tried using Enbugger within my .t file (although a solution which wouldn’t require me to edit the .t file for the purpose of adding debugging functionality would be highly desirable), but this didn’t work quite right, even using Enbugger’s default, which is the default Perl debugger. This is because the test suite captures a lot of standard output and standard errors (including what perldb might generate), so much of the meaningful output is delayed until after I manually quit the editor,
Enbugger supports a few Perl debuggers, but doesn’t support Ptkdb; there is a stub for Ptkdb which makes it clear that the Enbugger developer thought about Ptkdb, but didn’t get around to it.
I’m open to the idea of using a different graphical debugger such as ddd (which in the Perl context is a wrapper around perldb), but even ddd would (I think) have trouble with the suppressed-data described above.
I'm also open to trying trepan, which is supported by Enbugger, but am having trouble installing it, and am generally unfamiliar with it, and also have my doubts as to whether it would work in this challenging context.
Has anyone come up with a solution to this problem? Or do you just accept that Unit Tests need to be debugged the old fashioned way, with print statements?
Thanks …
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: graphical debugger, in a unit-test environment?
by Laurent_R (Canon) on Jan 10, 2015 at 00:24 UTC | |
by RonW (Parson) on Jan 10, 2015 at 01:14 UTC | |
|
Re: graphical debugger, in a unit-test environment?
by Anonymous Monk on Jan 09, 2015 at 22:59 UTC | |
|
Re: graphical debugger, in a unit-test environment?
by RonW (Parson) on Jan 09, 2015 at 23:37 UTC | |
|
Re: graphical debugger, in a unit-test environment?
by belden (Friar) on Jan 15, 2015 at 17:50 UTC |