Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any good automated test suites for Perl? [closed]

Can someone suggest some good automated test suite framework for Perl?

like image 867
Jagmal Avatar asked Sep 08 '08 13:09

Jagmal


2 Answers

It really depends on what you're trying to do, but here's some background for much of this.

First, you would generally write your test programs with Test::More or Test::Simple as the core testing program:

use Test::More tests => 2;

is 3, 3, 'basic equality should work';
ok !0, '... and zero should be false';

Internally, Test::Builder is called to output those test results as TAP (Test Anything Protocol). Test::Harness (a thin wrapper around TAP::Harness), reads and interprets the TAP, telling you if your tests passed or failed. The "prove" tool mentioned above is bundled with Test::Harness, so let's say that save the above in the t/ directory (the standard Perl testing directory) as "numbers.t", then you can run it with this command:

prove --verbose t/numbers.t

Or to run all tests in that directory (recursively, assuming you want to descend into subdirectories):

prove --verbose -r t/

(--verbose, of course, is optional).

As a side note, don't use TestUnit. Many people recommend it, but it was abandoned a long time ago and doesn't integrate with modern testing tools.

like image 168
Ovid Avatar answered Oct 15 '22 11:10

Ovid


Check out CPAN Testers, which have a lot of tools for automated testing. Most of that should be on CPAN so you'll be able to modify it to meet your needs. It's also very easy to write your own tester using TAP::Harness.

What exactly do you need to do and how are you trying to fit it into your process?

like image 35
brian d foy Avatar answered Oct 15 '22 10:10

brian d foy