Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^4: Get the number of the current test when debugging a test script

by Dumu (Monk)
on Jul 01, 2015 at 09:47 UTC ( [id://1132780]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Get the number of the current test when debugging a test script
in thread Get the number of the current test when debugging a test script

I like the debugger: it allows you to break, then perform multiple test examining variables, data structures etc. without getting mixed up in all of your program's other output. Also, you don't have to mess up your source code with print statements.

I do use print, say, Data::Printer, Data::Dumper etc. as well. The debugger allows you to do all that but wtih more flexibility, as well as trace code execution, of course. It's like fast-forwarding through a movie instead of taking a photograph - in a way.

If you want the debugger to stop at a place in the source code, you can just type:

$DB::single=1;

This puts a breakpoint in the Perl code. You can then just type 'c' at the DB prompt to zoom straight there.


Update

And to answer your question properly, I do use test comments. But test comments need not be unique (they may not be if you're running someone else's tests, even if yours are) and are often similiar to other test comments.

I caught sight of the test number after which the bug was occurring in the test output, and I wanted to know how to go straight there with the debugger. That's all.

  • Comment on Re^4: Get the number of the current test when debugging a test script
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1132780]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-25 23:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found