Test::More
{{Infobox software
| name = Test::More
| logo =
| screenshot =
| caption =
| author = Michael G Schwern
| developer = Chad 'Exodist' Granum
| released = April, 2001
| latest release version =
| latest release date =
| operating system = Cross-platform
| language = English
| programming language = Perl
| genre = Unit testing module
| license = Dual-licensed - Artistic License and GPL
| website = https://metacpan.org/pod/Test::More
}}
{{Portal|Free and open-source software}}
Test::More is a unit testing module for Perl. Created and maintained by Michael G Schwern with help from Barrie Slaymaker, Tony Bowden, chromatic, Fergal Daly and perl-qa.
Test::More is the most popular Perl testing module, as of this 2010 about 80% of all CPAN distributions made use of it.{{Cite web|url=https://metacpan.org/pod/Test::Most|title=Test::Most|last=Poe|first=Curtis|publisher=CPAN}}
History
Introduced in 2001 to replace Test.pm, Test::More simplified the culture of testing in Perl leading to a proliferation of new testing modules and a strongly test driven community.
In January–March 2014 Michael Schwern transferred ownership of Test::More and related modules to Chad 'Exodist' Granum.{{Cite web|url=http://blogs.perl.org/users/chad_exodist_granum/2014/03/testmore---new-maintainer-also-stop-version-checking.html|title=Test::More - New Maintainer, Also stop version checking!|last=Granum|first=Chad|date=14 March 2014}} On May 10, 2016 Exodist released version 1.302015{{Cite web|url=https://metacpan.org/pod/release/EXODIST/Test-Simple-1.302015/lib/Test/More.pm|title=Test::More|publisher=CPAN}}{{cite web|url=http://blogs.perl.org/users/chad_exodist_granum/2016/05/test2test-simple-released.html|title=Test2+Test-Simple released!|last=Granum|first=Chad|date=9 May 2016}} which included a complete refactor and partial rewrite of the internals. The new version includes major API updates and introduced several enhanced features. Extreme care was taken to preserve backwards compatibility for third party tools.{{Tone inline|date=January 2019}}
Functionality
Test::More is not a framework but can be used in conjunction with other testing libraries via a shared Test::Builder object. As a result, Test::More provides the baseline testing functions leaving other libraries to implement more specific and sophisticated functionality. This removes what would otherwise be a development bottleneck and allows a rich ecosystem of specialized niche testing functions.
Test::More is not a complete testing framework. Rather, test programs written with Test::More output their results as TAP which can then either be interpreted by a human, or more usually run through a TAP parser such as Test::Harness.{{cite book|title=Perl Best Practices|last=Conway|first=Damian|publisher=O'Reilly Media|date=2005|isbn=9780596001735}}{{rp|424}} It is this separation between test program and test result interpreter via a common protocol which allows Perl programmers to develop so many different testing modules and use them in combination. Additionally, the TAP output can be stored and reinterpreted later providing a historical record of test results.
Among its features are more comprehensive error messages, functions to test regular expressions, functions to test objects, and functions to test complex data structures.{{cite book|title=Writing Perl Modules for CPAN|last=Tregar|first=Sam|publisher=Apress|date=2002|isbn=9781430211525}}{{rp|115}} It can be used to compare values, such as a computed value to an expected value, or that a value is within an expected range.{{cite book|title=Advanced Perl Programming|last=Cozens|first=Simon|publisher=O'Reilly Media|date=2005|isbn=9781449378912}}{{rp|217}} The number of tests to be executed is listed in the test script.{{cite book|title=Developing Web Applications with Apache, MySQL, Memcached, and Perl|last=Galbraith|first=Patrick|publisher=Wiley|date=2009|isbn=9780470538326}}{{rp|202}}
Tests that are known to fail under specific conditions or environments can be skipped.{{rp|115}} This may occur if a system on which the test is executed lacks the capability to execute the tested function, or if the test is written in advance of the code.{{rp|218}}
The module intercepts standard output from the Perl script to execute the tests.{{cite book|title=The Definitive Guide to Catalyst|last1=Diment|first1=Kieren|last2=Trout|first2=Matt|publisher=Apress|date=2009|isbn=9781430223665}}{{rp|31}}
References
{{Reflist}}
External links
- [https://metacpan.org/pod/Test::More Test::More documentation]
- [https://metacpan.org/pod/Test::Tutorial Test::More tutorial]
{{Perl}}
Category:Unit testing frameworks
Category:Cross-platform software
Category:Software using the Artistic license
{{Programming-software-stub}}