Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Alias (5735)

Alias
  (email not shown publicly)
http://ali.as/

Journal of Alias (5735)

Wednesday July 19, 2006
05:12 AM

Test::Script and Devel::Pler Released

[ #30339 ]

Driven by the need for some quicky modules on aformentioned $work projects, I've just written and uploaded Test::Script 0.01 and Devel::Pler 0.08 to CPAN.

Test::Script is born of my frustration in not having the equivalent of a use_ok test for Perl scripts that can work safely across all platforms, and thus be safe to depend on. I find from time to time I upload a script with a typo of simple syntax error by accident, and these aren't being caught by my normal 01_compile.t, which is where I normally do an initial use_ok of everything in the distribution.

Devel::Pler is a little more interesting. It provides you with a script called pler.

pler is intended as a DWIM (intially for the case where the "I" == "me") wrapper for the Perl debugger when working on Perl distributions.

I'm not a text-mode programmer and I'm not a sysadmin, and I never want to be. And so I find needing to do things like "make && perl -Mblib -d t/04_some_test.t" over and over and over again to be annoying.

prove is a great program for running tests sanely with a minimum of keystrokes, but it doesn't handle debugging, and isn't really designed to.

So if you want a mental equivalent, pler is the equivalent of prove, but for debugging test scripts.

It looks where you are, reruns make if needed, does a few other bits and pieces if needed, and then hands off to the perl debugger.

So if you want to debug a script, all you need to do is:

    perl Makefile.PL
    pler t/02_script.t

I chose the name in part because every Perl programmer already has those finger-positions hardwired into their brain, so it's fast as hell to type, and in part because it was one of the few sequences of characters I could find that isn't already being used be something else. (and partly in homage to Drawn Together :) )

pler also takes into account that some modules don't need to have their Makefile.PL run to debug/test them. So if you run pler t/02_script.t and you don't have a Makefile, it will -I your lib dir instead and launch using the lib version.

And there's more bits to come as I think of them. One I want to add is that if you run C inside the t directory, it will make sure the actual debugging session is run from the root of the distribution (as it would during a real make test run).

But of course, as much as I like the name, my apologies go to all Japanese Perl coders (since I'm told it's "not easy" by my flatmate's Japanese girlfriend).

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.