NAME

Test::Regression - Test library that can be run in two modes: once to generate outputs and secondly to compare against them

VERSION

Version 0.02

SYNOPSIS

use Test::Regression; ok_regression(sub {return "hello world"}, "t/out/hello_world.txt");

EXPORT

ok_regression

FUNCTIONS

ok_regression

This function requires two arguments: a CODE ref and a file path. The CODE ref is expected to return a SCALAR string which can be compared against previous runs. If the TEST_REGRESSION_GEN is set to a true value, then the CODE ref is run and the output written to the file. Otherwise the output of the file is compared against the contents of the file. There is a third optional argument which is the test name.

AUTHOR

Nicholas Bamber, <nicholas at periapt.co.uk>

BUGS

Please report any bugs or feature requests to bug-test-regression at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Regression. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

testing of STDERR

The testing of stderr from this module is not as thorough as I would like. Test::Builder::Tester allows turning off of stderr checking but not matching by regular expression. Handcrafted efforts currently fall foul of Test::Harness. Still it is I believe adequately tested in terms of coverage.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Test::Regression

You can also look for information at:

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2009 Nicholas Bamber.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.