NAME
Test::Named - Perl extension for named tests. Inspired on this:
http://www.modernperlbooks.com/mt/2013/05/running-named-perl-tests-from-prove.html
SYNOPSIS
#################
# WITH PLAN #
#################
# load your fav test harness
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
DESCRIPTION
This module is a very thin wrapper that allows easy named testing much like JUnit-based testing frameworks.
EXPORT
This module exports a subroutine named main() and two hooks before_lauch and before_exit that are setup using code references (see SYNOPSIS above)
SEE ALSO
https://github.com/aimass/Test-Named
AUTHOR
Alejandro Imass, https://github.com/aimass
COPYRIGHT AND LICENSE
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.