Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re^2: Get the number of the current test when debugging a test scriptby Dumu (Monk) |
on Jul 01, 2015 at 12:42 UTC ( [id://1132802]=note: print w/replies, xml ) | Need Help?? |
So the answer seems to be that you can just create a reference to the $builder object at any time, either in your test script:
or in the debugger ('my' doesn't seem to play well on the debugger command line): NB for newbies: the DB<x> bit is the debugger prompt, not part of the code.
If you do either of the above, you should find you can subsequently do either of the following in the debugger to print out the current (actually, the latest) test number:
- or, as I originally sought to do, run the debugger and break after a particular test, e.g. test #20:
Some Monks seem uncomfortable with the idea of running a test script through a debugger. I can sort of understand what you're saying, folks: a test script is effectively a static debugging service, so why run it through the debugger as well? I have a few answers to this but the simplest are: "... Perl tests are just Perl code." -- chromatic, in Organizing Perl Test Files "TIMTOWTDI!" -- TimToady Feel free to get in touch if you would like a couple more.
In Section
Seekers of Perl Wisdom
|
|