Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 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::StubGenerator 0.9.5

    Download button

    No screenshots available
    Downloads: 442  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Fair (2.7/5)
    9 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Kent Cowgill | More programs
    Perl Artistic License / FREE
    July 24th, 2008, 13:42 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Test::StubGenerator description

    Test::StubGenerator is a simple module that analyzes a given source file and automatically generates t/*.t style tests.

    Test::StubGenerator is a simple module that analyzes a given source file and automatically generates t/*.t style tests for subroutines/methods it encounters.

    SYNOPSIS

    use Test::StubGenerator;

    my $stub = Test::StubGenerator->new(
    {
    file => '/path/to/MyModule.pm',
    tidy => 1,
    }
    );

    print $stub->gen_testfile;

    Or, from the command line (split for easier reading):

    $ perl -MTest::StubGenerator -e '
    > my $stub = Test::StubGenerator->new({ file => "Module.pm" });
    > print $stub->gen_testfile;' > Module.t

    Test::StubGenerator is a module that attempts to analyze a given source file and automatically create testing stubs suitable for unit testing your code.

    Test::StubGenerator make use of PPI in order to parse your code, looking for constructors and methods for modules (.pm), and subroutines for Perl script files (.pl).

    Test::StubGenerator also runs the generated tests through Perl::Tidy before returning the text of the tests to you, though this can be disabled.

    The idea for Test::StubGenerator grew out of a vim plugin I wrote that created test stub files in a very similar fashion. However, the line-based nature of vimscript quickly indicated that adding default parameters to the tests would prove to be an exercise in futility. As this was a feature I very much wanted to implement, I naturally turned to Perl, and PPI.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    generate tests | subroutine tests | Perl module | subroutine | tests | generator

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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