.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Test::FITesque 3pm" .TH Test::FITesque 3pm "2022-07-04" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Test::FITesque \- the FITesque framework! .SH "VERSION" .IX Header "VERSION" Version 0.04 .SH "DESCRIPTION" .IX Header "DESCRIPTION" Test::FITesque is a framework designed to emulate the \s-1FIT\s0 framework, but with a more perlish touch. While it is possible to use the \s-1FIT\s0 framework from within perl, it has a lot of unnecessary overhead related to its origins in the Java world. .PP I created Test::FITesque for the following reasons: .IP "\(bu" 4 I wanted to store my fixture tables in whatever format i wanted (\s-1JSON, YAML,\s0 Storable, etc) .IP "\(bu" 4 I wanted to simplify the execution process to make it very transparent. I have used FitNesse up to this point along with the perl server, but found that the java framework was painful to debug and overly complex for the task it needed to achieve. .IP "\(bu" 4 I wanted to use the normal perl testing tools and utilities to fit my workflow more closely. .IP "\(bu" 4 I also wanted to be able to save the \s-1TAP\s0 output to more easily capture test results over time to track regressions and problematic tests. .SH "INTRODUCTION" .IX Header "INTRODUCTION" FITesque starts with creating FITesque fixtures which are simply packages which allow for the creation of objects upon which methods can be called. .PP .Vb 1 \& package MyApp::Test::Fixture; \& \& use strict; \& use warnings; \& use base qw(Test::FITesque::Fixture); \& use Test::More; \& \& file_exists : Test { \& my ($self, $file) = @_; \& \& ok \-e $file, qq{File \*(Aq$file\*(Aq exists}; \& } .Ve .PP This simple fixture can now be run with a very basic and simple test. .PP .Vb 7 \& my $test = Test::FITesque::Test\->new({ \& data => [ \& [\*(AqMyApp::Test::Fixture\*(Aq], \& [\*(Aqfile_exists\*(Aq, \*(Aq/etc/hosts\*(Aq] \& ] \& }); \& $test\->run_tests(); .Ve .PP The data option is simply a table of data to use when executing the fixture test. The first row must refer to the name of the Test::FITesque::Fixture based fixture you wish to execute (like MyApp::Test::Fixture above). Any other cells in this row will be passed to the \fBnew()\fR method on the Fixture class. .PP The following rows are all method calls on an instance of the Fixture class. This first cell must refer to a method name in the Fixture class, all following cells will be passed to the methods as arguments. .PP The \fBrun_tests()\fR method on the FITesque test will simply run these methods in the order specified while taking care of maintaining \s-1TAP\s0 test count and the like underneath. .PP If you have more than one instance of a test to run, you can add it to a suite. .PP .Vb 4 \& my $suite = Test::FITesque::Suite\->new({ \& data => [$test1, $test2, $test3] \& }); \& $suite\->run_tests(); .Ve .PP This will also allow you to run test fixtures in a more dynamic fashion while still taking care of \s-1TAP\s0 test count. .PP Suites can not only take a list of tests to run, but also suites themselves. .PP The Test::FITesque package also supplies some handy helper functions to wrap most of the logic up for you. Please see the \s-1SYNOPSIS\s0 below for more information. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Test::FITesque; \& \& run_tests { \& suite { ... }, \& test { \& [\*(AqMyApp::Test::Fixture\*(Aq], \& [\*(Aqfile_exists\*(Aq, \*(Aq/etc/hosts\*(Aq] \& } \& }; .Ve .SH "EXPORTED FUNCTIONS" .IX Header "EXPORTED FUNCTIONS" .SS "test" .IX Subsection "test" .Vb 6 \& test { \& [\*(AqFixture::Class\*(Aq], \& [\*(Aqdivides\*(Aq, qw(8 4 2)], \& [\*(Aqmultiplies\*(Aq, qw(5 6 30)], \& [\*(Aqadds\*(Aq, qw(4 3 7)], \& } .Ve .PP This function will return a Test::FITesque::Test object. It takes a coderef which returns a list of array references of which the first must refer to your FITesque fixture. .SS "suite" .IX Subsection "suite" .Vb 10 \& suite { \& test { \& ... \& }, \& test { \& ... \& }, \& suite { \& test { \& ... \& } \& }, \& } .Ve .PP This function will return a Test::FITesque::Suite object. It takes a coderef which returns a list of Test::FITesque::Test objects or/and Test::FITesque::Suite objects. .SS "run_tests" .IX Subsection "run_tests" .Vb 8 \& run_tests { \& suite { \& ... \& }, \& test { \& ... \& } \& } .Ve .PP This function takes a coderef of suite and/or test objects. This will then wrap these all into a suite and call Test::FITesque::Suite's run_tests method. .SH "SEE ALSO" .IX Header "SEE ALSO" Test::FITesque::Fixture, Test::FITesque::Test, Test::FITesque::Suite .SH "TEST COVERAGE" .IX Header "TEST COVERAGE" This distribution is heavily unit and system tested for compatibility with Test::Builder. If you come across any bugs, please send me or submit failing tests to Test-FITesques \s-1RT\s0 queue. Please see the '\s-1SUPPORT\s0' section below on how to supply these. .PP .Vb 9 \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \& File stmt bran cond sub pod time total \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \& blib/lib/Test/FITesque.pm 100.0 100.0 n/a 100.0 100.0 5.2 100.0 \& .../Test/FITesque/Fixture.pm 100.0 100.0 100.0 100.0 100.0 29.1 100.0 \& ...ib/Test/FITesque/Suite.pm 100.0 100.0 100.0 100.0 100.0 14.6 100.0 \& ...lib/Test/FITesque/Test.pm 100.0 100.0 100.0 100.0 100.0 51.1 100.0 \& Total 100.0 100.0 100.0 100.0 100.0 100.0 100.0 \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- .Ve .SH "AUTHOR" .IX Header "AUTHOR" Scott McWhirter, \f(CW\*(C`\*(C'\fR .SH "TODO" .IX Header "TODO" .IP "\(bu" 4 Add more documentation .IP "\(bu" 4 Add some cookbook examples .IP "\(bu" 4 Look at some of the Fixture base class code to see if it can be restructured to allow for more evil coderef support. .IP "\(bu" 4 Update code to take advantage of newer Test::Harness/Test::Builder features. .SH "BUGS" .IX Header "BUGS" Please report any bugs or feature requests to \&\f(CW\*(C`bug\-test\-fitesque at rt.cpan.org\*(C'\fR, or through the web interface at . I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. .SH "LIMITATIONS" .IX Header "LIMITATIONS" Due to limitations in the \s-1TAP\s0 protocol and perl's \s-1TAP\s0 tools such as Test::Harness, all Fixture tables have to be held in memory. It also means that Fixture tables cannot be treated as a stream so there is no easy way to separate out which tables output is which. To remedy this, I suggest that you pass a 'name' parameter to the Fixture classes constructor and print this to screen or use the \fBdiag()\fR function from Test::More. .SH "SUPPORT" .IX Header "SUPPORT" You can find documentation for this module with the perldoc command. .PP .Vb 1 \& perldoc Test::FITesque .Ve .PP You can also look for information at: .IP "\(bu" 4 AnnoCPAN: Annotated \s-1CPAN\s0 documentation .Sp .IP "\(bu" 4 \&\s-1CPAN\s0 Ratings .Sp .IP "\(bu" 4 \&\s-1RT: CPAN\s0's request tracker .Sp .IP "\(bu" 4 Search \s-1CPAN\s0 .Sp .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright 2007 Scott McWhirter, all rights reserved. .PP This program is released under the following license: \s-1BSD.\s0 Please see the \&\s-1LICENSE\s0 file included in this distribution for details.