Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Unit Testing in Perl

by eyepopslikeamosquito (Chancellor)
on Jun 26, 2005 at 05:50 UTC ( #469999=note: print w/replies, xml ) Need Help??


in reply to Unit Testing in Perl

As indicated here and here, Test::Unit appears to have been abandoned. 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).

Replies are listed 'Best First'.
Re^2: Unit Testing in Perl
by skyknight (Hermit) on Jun 26, 2005 at 12:28 UTC
    Yes, I was gradually getting the impression that using Test::Unit might be a mistake, even though at first glance it seems like the natural choice if you are xUnit inclined. Does the fact that it neglects to base it itself on Test::Builder mean that it does not play nicely with the stadard testing phase of CPAN style module distributions? If Test::Unit seemed reasonably close to what I wanted, what is the closest thing that behaves in an appropriately Perlish fashion?

      Does the fact that it neglects to base it itself on Test::Builder mean that it does not play nicely with the standard testing phase of CPAN style module distributions?
      Not being based on Test::Builder makes it difficult to extend or integrate with other CPAN testing modules. See the excellent documentation that comes with Test::Class for more details.

      If Test::Unit seemed reasonably close to what I wanted, what is the closest thing that behaves in an appropriately Perlish fashion?
      Test::Class. However, don't forget plain ol' Test::More in cases where Test::Class may be overkill.

      Does the fact that it neglects to base it itself on Test::Builder mean that it does not play nicely with the stadard testing phase of CPAN style module distributions?

      Yes and no.

      T::U can be made to output TAP (using Test::Unit::HarnessUnit) which means Test::Harness can understand it's output, so you can integrate it into the normal CPAN testing phase.

      This disadvantages are that:

      • It doesn't support all of TAP - so you cannot use things like SKIP and TODO tests if you want to
      • Since it is not based on Test::Builder it doesn't integrate with all of the other Test::Builder based modules on CPAN - so you may end up reinventing some existing wheels
      • Since it's not a core module (unlike Test::More) you have an extra dependency to install.

      Well - that and the fact that its huge, overcomplicated and pretty much unmaintained :-)

      If Test::Unit seemed reasonably close to what I wanted, what is the closest thing that behaves in an appropriately Perlish fashion?

      Test::Class - but I would say that :-)

      If Test::Unit does what you want, but sucks, then perhaps you could consider taking it over, upgrading it to use Test::More or some other TAP-based module, and improving it as you see fit?
        If Test::Unit does what you want, but sucks, then perhaps you could consider taking it over, upgrading it to use Test::More or some other TAP-based module, and improving it as you see fit?

        As pointed out earlier I've already volunteered for this. I did get around to mailing the maintainers and never got a reply. I should really chase it up.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://469999]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2018-11-19 09:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My code is most likely broken because:
















    Results (209 votes). Check out past polls.

    Notices?