The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

DB::Pluggable::Plugin::BreakOnTestNumber - Debugger plugin to break on Test::Builder-based tests

VERSION

version 1.111750

SYNOPSIS

    $ cat ~/.perldb

    use DB::Pluggable;
    DB::Pluggable->run_with_config(\<<EOINI)
    [BreakOnTestNumber]
    EOINI

    $ perl -d foo.pl

    Loading DB routines from perl5db.pl version 1.28
    Editor support available.

    Enter h or `h h' for help, or `man perldebug' for more help.

    1..9
    ...
      DB<1> b #5
      DB<2> r

DESCRIPTION

This debugger plugin extends the debugger's b command - used to set breakpoints - with the ability to stop at a specific test number. Andy Armstrong had the idea and wrote the original code, see http://use.perl.org/~AndyArmstrong/journal/35792.

METHODS

initialize

Sets up the command handler that checks whether the command is of the form b #12 or b #12, 34, .... If so, it sets breakpoints to break as soon as the given test has finished. If test-based breakpoints have been found, the standard DB::cmd_b() function that handles the b command is short-circuited.

If it handles the command, it enables the watchfunction().

This plugin overwrites Test::Builder::lock() to be able to detect that a test is about to be finished - see the source code of Test::Builder for details. Yes, this is nasty. It also means that this plugin will break Test::Builder when using threads.

watchfunction

Checks the current test number from Test::Builder and instructs the debugger to stop if an appropriate test number has been reached.

INSTALLATION

See perlmodinstall for information and options on installing Perl modules.

BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests through the web interface at http://rt.cpan.org/Public/Dist/Display.html?Name=DB-Pluggable.

AVAILABILITY

The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit http://www.perl.com/CPAN/ to find a CPAN site near you, or see http://search.cpan.org/dist/DB-Pluggable/.

The development version lives at http://github.com/hanekomu/DB-Pluggable and may be cloned from git://github.com/hanekomu/DB-Pluggable.git. Instead of sending patches, please fork this project using the standard git and github infrastructure.

AUTHOR

Marcel Gruenauer <marcel@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2008 by Marcel Gruenauer.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.