in reply to Re: Re: RFC: Runnable test code integrated into Modules.
in thread RFC: Runnable test code integrated into Modules.

Basically because it ignores Test::Builder, and the modules built with it.

So we have yet another set of testing functions (assert_somethingorother in Test::Extremes case), and no way of adding new kinds of test to the framework easily. Test aren't named either which makes using large test suites a complete pain.

It also slightly annoys me by saying it's in an xUnit style when it doesn't do most of the things that an xUnit framework does (setting up of test fixtures, composition of test suites, etc.). This kind of thing isn't "OO cruft" as it says in the documentation - they're tools that make some kind of testing a lot easier.

If you need things like text fixtures then Test::Extreme won't do the job. If you don't need them then there are better testing tools available with Test::More and friends.

All IMHO of course ;-)

Replies are listed 'Best First'.
Re: Re^3: RFC: Runnable test code integrated into Modules.
by dda (Friar) on Sep 13, 2003 at 13:50 UTC
    Thanks, that makes sense for me. And let me 'use' your one more time: what do you think about Test::Unit suite? Is it cute?

    --dda

      I would class it as "cute" - but I wouldn't use it.

      Bias alert. I wrote Test::Class because I wasn't happy Test::Unit. Please read the following with the appropriate grains of salt.

      This is what I said about Test::Unit when I discussed other xUnit frameworks in the Test::Class documentation.

      Test::Unit is a port of JUnit http://www.junit.org/ into perl. If you have used JUnit then the Test::Unit framework should be very familiar.

      It is class based so you can easily reuse your test classes and extend by subclassing. You get a nice flexible framework you can tweak to your heart's content. If you can run Tk you also get a graphical test runner.

      However, Test::Unit is not based on Test::Builder. You cannot easily move Test::Builder based test functions into Test::Unit based classes. You have to learn another test assertion API.

      Test::Unit implements it's own testing framework separate from Test::Harness. You can retrofit *.t scripts as unit tests, and output test results in the format that Test::Harness expects, but things like todo tests and skipping tests are not supported.

      So, for me, I would only recommend Test::Unit if you were really into JUnit and similar. Since it's a direct port of that framework to Perl it will be an instantly familiar environment.

      Because it's a direct port it fails to take full advantage of the existing Perl testing frameworks. It's support for Test::Harness is limited, and its integration with the de-facto standard Test::Builder based modules is non-existent.

      If you need fixtures, test classes, etc. then I would recommend using Test::Class instead - but I would say that wouldn't I :-)