Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hello All,
I am trying to build a regression tool. Found Perl::Unit to be an interesting framework for the same. What I have understood out of the available documentation is that I need to have a test suite,test cases,test runner. I have also taken help from available example with tar ball for this framework but it has left me uncertain about its usage. I need a small working example to understand the implementation along with little knowledge on the extensions to be used for test files. Can anyone help me knowing the flow of the code using this framework? I am getting very confused in Test::Unit::Procedural and Test::Unit::TestCase modules. Where to begin with?
Re: Test::Unit related query
by eyepopslikeamosquito (Archbishop) on Jan 15, 2013 at 12:15 UTC
|
Suggest you not get started with Perl::Unit at all. :)
You see, Perl::Unit aka Test::Unit appears
to have been abandoned,
as indicated
here and
here and
here.
Note that, unlike Perlish-mainstream Test:: modules, Test::Unit is not based on Test::Builder.
A common mistake I've seen from folks coming from a
non-Perl xUnit background
is to use Test::Unit in preference
to the Perl-mainstream and much more widely used Test::Builder/TAP/Test::More/Test::Class set of
modules ... only to regret that decision later.
Have a read of the "Other Modules for xUnit Testing in Perl" section of the
Test::Class
documentation, which compares Test::Class with
other xUnit-style Perl testing modules (including Test::Unit and Test::SimpleUnit).
| [reply] |
Re: Test::Unit related query
by Anonymous Monk on Jan 15, 2013 at 12:15 UTC
|
| [reply] |
|
I assumed he was talking about perlunit (sourceforge), which, if you squint you will notice
mentions Test::Unit, which I believe is essentially
the same as CPAN Test::Unit, which is
no longer being actively developed because, as you say,
the standard Perl testing framework, prove, Test::More,
Test::Class and all the other fine Test:: modules on CPAN, that work nicely with the standard Perl testing framework,
but do not work with Test::Unit, are so much better.
Update: In addition to the standard Perl documentation Test::More, prove etc., the excellent Perl Testing: A Developer's notebook has plenty of examples to get you started with Perl testing.
| [reply] |
|
| [reply] |
Re: Test::Unit related query
by Khen1950fx (Canon) on Jan 15, 2013 at 18:34 UTC
|
I took a look at it for you.
First, I installed it via CPAN---no problems. make, make test, and make install passed with no problems: however, when I went to double-check it with
pmload, pmload couldn't find it.
Second, I looked at the prerequiste list---it seemed to be missing a few modules. Here's my list of prerequisites. Run it, and if it works, cool. If it doesn't work---then you'll understand why people regret choosing it.
#!/usr/bin/perl
BEGIN {
$| = 1;
$^W = 1;
$ENV{'HARNESS_TIMER'} = 1;
$ENV{'TEST_POD'} = 1;
$ENV{'TEST_POD_COVERAGE'} = 1;
}
use strict;
use warnings;
use CPAN;
CPAN::Shell->install(qw(
Exporter
Carp
base
DB_File
List::Util
File::Spec
Test::Distribution
Test::Portability::Files
XSLoader
File::Path
AutoLoader
IO::Handle
constant
Test::Harness
Test::More
Data::Dumper
Encode
Pod::Man
Test
Text::Wrap
Pod::Escapes
Pod::Simple
ExtUtils::MakeMaker
Time::HiRes
ExtUtils::Constant
Perl::OSType
File::Temp
Text::ParseWords
Locale::Maketext::Simple
Module::Load
Locale::Maketext
Module::Load::Conditional
version
Locale::Maketext::Lexicon
Params::Check
Module::Metadata
IPC::Cmd
ExtUtils::CBuilder
Socket
Test::Pod
Pod::Coverage
Devel::Symdump
Test::Pod::Coverage
Class::Inner
Error
Test::Unit));
| [reply] [d/l] [select] |
|
Hey,
Thanks all of you guys! I get that Test::Unit is not a good choice. From all various package names I see posted here, please show me a small working example where I have a test suite which has 2 or three test cases and a test runner and reporting tool. Also I need to know, are there different extensions formats for any of the above (like .t or specifically having .lib folder to store all testsuite files etc). This will exactly solve my problem of visualizing what you all are talking about.
Thanks for all the responses!
| [reply] |
|
It is not clear to me exactly what you are asking for.
There are many good tutorials on Perl testing using the core Perl testing tools. For example:
If that is not what you wanted, please clarify.
| [reply] |
|
|