pileofrogs has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks!

Is there a reasonable way to run a Test::More test script through the perl debugger? prove -v -l lib -d t/01.foo.t doesn't do what I want. It just shows some debugging output about the prove command. I could re-write my .t script as a .pl script, but that seems silly. If I run perl -l lib -d t/01.foo.t it outputs nothing. Yes, running prove -l lib -v t/01.foo.t does output a lot of stuff.

I want to step through the execution of a test script.

Thanks!
--Pileofrogs

Replies are listed 'Best First'.
Re: Test::Harness and the Debugger
by Porculus (Hermit) on Aug 05, 2009 at 22:34 UTC

    I suspect the problem is that you should be using perl -I lib (capital i), not perl -l lib (lower-case L).

    What you want to do is tell Perl to add "lib" to the include path. What you've actually been doing is telling Perl to execute the script "lib" with magic newlines enabled. :)

    As for why Perl's reaction to being asked to execute a directory is to do nothing silently and signal success, I have no idea.

      Rad! I suck! Woo hoo!

Re: Test::Harness and the Debugger
by Boldra (Curate) on Aug 06, 2009 at 05:43 UTC
    Test programs are just perl programs, run them with perl:

    perl -d -Ilib t/mytest.t

    This is the same as running prove verbose, but don't get mixed up and try perl -d -Ilib t/*.t, perl won't glob those files like prove, it will only run the first test and pass the rest as parameters.
    (formatting update)


    - Boldra
Re: Test::Harness and the Debugger
by Anonymous Monk on Jan 24, 2014 at 03:16 UTC
    Hope no one minds if I resurrect this old chestnut to ask.. can this actually be done on a prove command rather than running a single test like any other .pl script? What I'm getting at is my scripts get gummed up when I use prove to run them in parallel and I'm having a hard time telling where prove ends and the scripts begin as far as what's causing this gridlock.