Test::Named - Perl extension for named tests. Inspired on this:
http://www.modernperlbooks.com/mt/2013/05/running-named-perl-tests-from-prove.html
################# # WITH PLAN # ################# # load your fav test harness use Test::More tests => 3; use Test::Named; # load module to test use_ok(Foo::Bar); # run all tests unless named test specified exit main( @ARGV ); # named tests are declared using test_ prefix sub test_foo { ... } sub test_bar { } etc.. ################# # NO PLAN # ################# # load your fav test harness - no plan use Test::More; use Test::Named; # load module to test use_ok(Foo::Bar); # use hooks to setup before and after testing before_launch(sub { ok(1, 'Before Launch Executed') }); before_exit( sub { done_testing() }); # run all tests unless named test specified exit main( @ARGV ); # named tests are declared using test_ prefix sub test_foo { ... } sub test_bar { } etc.. ################# # RUN TESTS # ################# prove -v -I lib/ t/* prove -v -I lib/ t/TestFile.t prove -v -I lib/ t/TestFile.t :: foo prove -v -I lib/ t/TestFile.t :: bar
This module is a very thin wrapper that allows easy named testing much like JUnit-based testing frameworks.
This module exports a subroutine named main() and two hooks before_lauch and before_exit that are setup using code references (see SYNOPSIS above)
https://github.com/aimass/Test-Named
Alejandro Imass, https://github.com/aimass
Copyright (C) 2022 by Alejandro Imass
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.35.10 or, at your option, any later version of Perl 5 you may have available.
To install Test::Named, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Named
CPAN shell
perl -MCPAN -e shell install Test::Named
For more information on module installation, please visit the detailed CPAN module installation guide.