Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Test::Group 0.18

    Download button

    No screenshots available
    Downloads: 315  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Dominique Quatravaux and Nicolas M. Thiéry | More programs
    Perl Artistic License / FREE
    December 5th, 2008, 15:55 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Test::Group description

    Test::Group - Group together related tests in a test suite

    Test::Group is a Perl module to group together related tests in a test suite.

    SYNOPSIS

     use Test::More no_plan => 1;
     use Test::Group;

     test "hammering the server" => sub {
     ok(I_can_connect);
     for(1..1000) {
     ok(I_can_make_a_request);
     }
     }; # Don't forget the semicolon here!

     test "this test group will fail", sub {
     ok 1, "sub test blah";
     is "foo", "bar"; # Oops!
     ok 1;
     like "blah blah blah", qr/bla/;
     };

     test "this test will fail but the suite will proceed", sub {
     pass;
     die;
     };

     test "a test with TODO in the name is marked TODO" => sub {
     pass("this part is done");
     fail("but I'm not finished with this one yet");
     };

     {
     local $TODO = "Test::More's good old method also works";
     test "this test is not finished yet" => sub {
     pass;
     fail;
     };
     };

     # Don't catch exceptions raised in test groups later on
     Test::Group->dont_catch_exceptions;

     # log caught exceptions in /tmp/log
     Test::Group->logfile("/tmp/log");

     # skip the next group of test
     skip_next_test "network not available" if (! Network->available());
     test "bla", sub {
     my $ftp = Net::FTP->new("some.host.name");
     # ...
     };

     begin_skipping_tests "reason";

     test "this test will not run" => sub {
     # ...
     };

     end_skipping_tests;

     # from now on, skip all tests whose names do not match /bla/
     test_only qr/bla/;


    Fed up with counting tests to discover what went wrong in your last test run? Tired of squinting at your test source to find out where on earth the faulty test predicate is called, and what it is supposed to check for? Then this module is for you!

    Test::Group allows for grouping together related tests in a standard Test::More-style script. (If you are not already familiar with Test::More, now would be the time to go take a look.) Test::Group provides a bunch of maintainability and scalability advantages to large test suites:

     * related tests can be grouped and given a name. The intent of the test author is therefore made explicit with much less effort than would be needed to name all the individual tests;
     * the test output is much shorter and more readable: only failed subtests show a diagnostic, while test groups with no problems inside produce a single friendly ok line;
     * no more tedious test counting: running an arbitrarily large or variable number of tests (e.g. in loops) is now hassle-free and doesn't clutter the test output.

    Authors of Test::* modules may also find Test::Group of interest, because it allows for composing several Test::More predicates into a single one (see "Reflexivity").


    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    group tests | test suite | Perl module | Perl | group | tests

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM