Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.
Getting tired of seeing your Test::Class driver classes look like this?
#!/usr/bin/perl -wT
use lib 't/tests', 't/lib';
use Test::Class;
use Tests::My::This;
use Tests::My::That;
use Tests::My::Big::Fat::Cheese;
#
#... 26 dull, boring lines go by, never to be remembered
#
use Tests::Did::I::Remember::To::Include::All::Of::My::Test::Classes;
Test::Class ->runtests;
Well, Adrian has released Test::Class 0.13, which now allows you to replace that with this:
use Test::Class::Load qw(t/tests t/lib);
Test::Class->runtests;
No more remembering to keep your driver script in synch with your test classes.
Never Been a Problem for Me (Score:1)
I usually use one driver script per test class. What are the benefits of glomming them all together, besides having fewer files?
Re: (Score:2)
You can still do one driver script per class, but there are two benefits to Test::Class::Load. When I'm writing a Test::Class program, I run those tests by typing ,t in vim. However, if I do that, it's easy to forget to write a helper script. A developer could easily check in test code which never gets run.
The second benefit accrues as you're writing larger test suites. Let's say you've written thirty test classes. Let's say that those thirty classes load an average of twenty modules each (this is re
Re: (Score:1)
I can understand that, but it's never been an issue for me. The largest test suite I have still takes only three or four minutes to run, and I like having the process boundary between separate tests.
Maybe it's my inexperience with this approach, but I distrust the lack of separation between units.
Re: (Score:1)
While three or four minutes isn't too bad (and I've seen Perl tests suites that take more than 90m to complete) my general feeling towards test suites is the shorter time they run - the more often I will run them. The quicker I can make that feedback loop the happier I am.
Re: (Score:2)
Actually, I do agree with chromatic on that one. If you don't realize that your state is changing between test methods, having tests run in alphabetical order can mask hidden assumptions in your tests. The obvious example is not doing proper setup and teardown on test databases. But a more subtle example is when naughty code decides to change a global's value. That can be extremely difficult to debug.
Re: (Score:1)
I generally find that these are more common than bugs hidden by a persistent environment. Maybe this is a side effect of my development style.
In general, in developer test land, I find tests involving lots of state cause more problems than they solve. Having tests that can run independently of each other is lovely.
You're spot on however with Test::Class's alphabetical
Re: (Score:1)
(of course breaking things up like this by class isn't ideal - but finer grained breakdowns are on the to do list)
I wonder (Score:1)
use lib 't/tests', 't/lib';
Does the lib pragma try to convert those paths to the native file system, or have we all just been doing it wrong all these years instead of doing catdir or path?
Re: (Score:1)
Yup. See perldoc lib :-)
Re: (Score:1)
This is from Perl 5.8.8. "In the future". Lot's of mention of MacOS. Nothing that leads me to believe that it's totally safe "now" vs. "in the future". :-)
Re: (Score:1)
seems pretty clean to me :-)
Re: (Score:1)
Re: (Score:2)
VMS users know that stuff doesn't work on their system, so it's OK to ship them broken code ;)
Re: (Score:1)
Re: (Score:2)
# VMS users wanting to put [.stuff.moo] into
# their @INC would write
use lib 'stuff/moo';
Ovid forgot to mention.... (Score:1)