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
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
useless complexity (Score:1)
Write your own use_ok() but leave mine alone (Score:2)
I like to have use_ok() give me its answer then let me decide what to do with it. It always sucks to have side effects forced on you. You want to die (although you probably really want to bail_out), but maybe I want to do something else, like tell a pre-commit hook something, try to log an error message, or whatever. If you want to attach extra behaviour, make a use_ok_or_die().
I have use_ok() duplicated in several test files. That allows me to run just a single test file with those sanity checks. If you're
You don't want it to be use.t (Score:1)
Every module I own (and all my work projects) have this, but explicitly as the first test.
01_compile.t is responsible for compiling and loading absolutely everything in the distribution (including test support libraries), for running perl -c tests on all included scripts, and for things which loads module trees automatically, also for making sure that the $VERSION's of the modules all match.
And if any of this fails, it should do a BAIL_OUT.
All of this runs FIRST, so that all of the rest of the tests can tru